# Mysterious redirect errors when logging in

**URL:** <https://community.auth0.com/t/mysterious-redirect-errors-when-logging-in/67171>\
**Category:** Get Help\
**Created:** [July 31, 2021, 11:24am UTC](https://community.auth0.com/t/mysterious-redirect-errors-when-logging-in/67171 "2021-07-31T11:24:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngma](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ngma/32/13374_2.png) [@ngma](https://community.auth0.com/u/ngma)\
**Post date:** [July 31, 2021, 11:24am UTC](https://community.auth0.com/t/mysterious-redirect-errors-when-logging-in/67171/1 "2021-07-31T11:24:29Z")

</div>

Hey all,

I am not sure if this is the right place to ask, but we are a startup that is using Auth0 for authentication, and after some recent changes in the onboarding flow, we are facing some mysterious callback errors that keep showing up from time to time. We get to see a message: “redirect too many times”, as if we are stuck in some kind of an infinite loop. Our users can frequently not log in to do their work. Our developer is struggling with fixing this issue and we are looking for an extra pair of eyes to help us find the bug in the implementation. I have attached the .har file which shows what happens when we try to login. Some addtional info: our web-application runs on flask backend and has vuejs frontend.

thank you in advance

[loginredirectissue.har](https://community.auth0.com/404) (495.3 KB)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 2, 2021, 5:54pm UTC](https://community.auth0.com/t/mysterious-redirect-errors-when-logging-in/67171/3 "2021-08-02T17:54:54Z")

</div>

Hi @ngma,

Welcome to the Auth0 Community!

It looks like you are sending your user to `/login?next=%2Flogout`, which directs your app to log your user out directly after successful login.

You are also sending a state value of `{"destination": "/logout"}` (I’m assuming you get this from the query param). This isn’t a unique value, and could be used by a malicious party to redirect users to any site after login. You should use [one of these strategies](https://auth0.com/docs/protocols/state-parameters) to redirect users after login.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 23, 2021, 4:34pm UTC](https://community.auth0.com/t/mysterious-redirect-errors-when-logging-in/67171/4 "2021-08-23T16:34:45Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
