# Redirect does not work consistently

**URL:** <https://community.auth0.com/t/redirect-does-not-work-consistently/13751>\
**Category:** Get Help\
**Tags:** login, auth0, lock\
**Created:** [July 30, 2018, 2:29pm UTC](https://community.auth0.com/t/redirect-does-not-work-consistently/13751 "2018-07-30T14:29:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haha-no](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@haha-no](https://community.auth0.com/u/haha-no)\
**Post date:** [July 30, 2018, 2:29pm UTC](https://community.auth0.com/t/redirect-does-not-work-consistently/13751/1 "2018-07-30T14:29:26Z")

</div>

hi,

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 25, 2018, 7:16am UTC](https://community.auth0.com/t/redirect-does-not-work-consistently/13751/2 "2018-10-25T07:16:09Z")

</div>

Hey @haha-no !

Can you let me know how it behaves when it’s not working as expected? Does it redirect you somewhere else than specified in the redirectUrl? What version of the library are you using?
