Self-hosting doesn't redirect to the original page after login success

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,
network: ‘mainnet’
const EMAIL_PASSWORD = ‘email_password’;
const HOSTED_EMAIL_PASSWORDLESS = ‘hosted_email_passwordless’;
const AUTH_DOMAIN = process.env.NEXT_PUBLIC_AUTH0_DOMAIN; //

const _loginToConnectionMap = (): Record<string, any> => {
	return {
			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,


Originally posted by: polartar

Check the discussion at:

Hey @talentdev2020 which particular SDK are you using? Torus Direct SDK is a bit outdated, you can utlise our Web3Auth Self Host intead:

Also if you want to use our CustomAuth SDK, here are the documentations around that:

Originally posted by: yashovardhan