Auth0 Home Blog Docs

Redirect does not work consistently

lock
auth0
login

#1

hi,

I find that setting redirect: true not always works as expected:

const lock = new Auth0Lock(
	AUTH0_CLIENT_ID,
	AUTH0_DOMAIN,
	{
		// [...]
		auth: {
			redirect: true,
			redirectUrl: `${window.location.origin}/authenticated`,
			// [...]

		},
		// [...]
	}
);

lock.on('authenticated', (authResult) => {
	// gets executed, when clicking the button to login using the previously 
	// used account. — not when clicking `not your account?`, and logging in 
	// anew (in which case I get redirected to `redirectUrl`).
});

what’s going wrong here?