I attached the image. When clicking the Google button, it shows google popup to authorize by google.
After google login success, it should disappear and redirect to the original login page. but it isn't closed and shows the login page there..
The code looks like this
const torusdirectsdk = new TorusSdk({
baseUrl: ${window.location.origin}
,
// user will be redirect to auth page after login
redirectPathName: ‘auth/login’,
enableLogging: true,
// uxMode: UX_MODE.REDIRECT,
network: ‘mainnet’
});
const EMAIL_PASSWORD = ‘email_password’;
const HOSTED_EMAIL_PASSWORDLESS = ‘hosted_email_passwordless’;
const AUTH_DOMAIN = process.env.NEXT_PUBLIC_AUTH0_DOMAIN; //dev-gin32n8q.us.auth0.com
const _loginToConnectionMap = (): Record<string, any> => {
return {
[EMAIL_PASSWORD]: { domain: AUTH_DOMAIN },
[HOSTED_EMAIL_PASSWORDLESS]: {
domain: AUTH_DOMAIN,
verifierIdField: 'name',
connection: '',
isVerifierIdCaseSensitive: false
}
};
};
await torusdirectsdk.init({ skipSw: true });
if (!process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID) return;
const jwtParams = _loginToConnectionMap()[‘google’] || {};
const loginDetails = await torusdirectsdk?.triggerLogin({
typeOfLogin: ‘google’,
verifier: ‘web3aut-verifier’,
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
jwtParams
});
Originally posted by: polartar
Check the discussion at: https://github.com/orgs/Web3Auth/discussions/494