Archived Content from Web3Auth Community
This topic was originally posted by abhishek on 8/4/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.
When trying to login, getting the following error:
[TypeError: Cannot set property 'sessionKey' of undefined]
- SDK Version: 4
- Expo or Bare Version: Expo 48.0.18
- Screenshots of error:
**Web3Auth initialization and login code snippet: **
import Web3Auth, { OPENLOGIN_NETWORK, LOGIN_PROVIDER, } from "@web3auth/react-native-sdk"; import * as SecureStore from "expo-secure-store"; import * as WebBrowser from "expo-web-browser"; import Constants, { AppOwnership } from "expo-constants"; import * as Linking from "expo-linking";const scheme = “protodeplan”;
const resolvedRedirectUrl =
Constants.appOwnership === AppOwnership.Expo ||
Constants.appOwnership === AppOwnership.Guest
? Linking.createURL(“web3auth”, {})
: Linking.createURL(“web3auth”, { scheme });const clientId =
“BFfDDu0Ba-UOQVhKbbEB9hLA4U03HkUCCUTSGrkCDv9mF0JaYa40CKg42KPsj1ZLy5rklMd9G4Hdl0LFFp1inh8”;const login = useCallback(async () => {
try {
const web3auth = new Web3Auth(WebBrowser, SecureStore, {
clientId,
network: OPENLOGIN_NETWORK.TESTNET,
});await web3auth.login({ loginProvider: LOGIN_PROVIDER.GOOGLE, useCoreKitKey: false, redirectUrl: resolvedRedirectUrl, curve: "ed25519", }); } catch (error) { console.log("error: ", error); }
}, );