# Unexpected redirect to '/'

**URL:** <https://community.auth0.com/t/unexpected-redirect-to/186778>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [May 15, 2025, 12:51pm UTC](https://community.auth0.com/t/unexpected-redirect-to/186778 "2025-05-15T12:51:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michivo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michivo/32/71229_2.png) [@michivo](https://community.auth0.com/u/michivo)\
**Post date:** [May 15, 2025, 12:51pm UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/1 "2025-05-15T12:51:35Z")

</div>

We’re using Auth0 in a Vue application. It’s set up as a SPA Application. in Auth0. When initializing the the auth0 plugin, it seems to trigger a redirect to ‘/’ . This happens immediately after calling createAuth0(). This leads to a infinite redirect loop. Only authorized users are allowed to access /, so we redirect them to our ‘/auth’ page. Then, Auth0 immediately redirects back to /, and so on.  
Is there any way to keep Auth0 from doing this?  
I have already tried to set `skipRedirectCallback` to true when calling createAuth0, but that didn’t help.

---

<div class="post-metadata">

**Author:** ![teodor.andrei](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/teodor.andrei/32/75320_2.png) [@teodor.andrei](https://community.auth0.com/u/teodor.andrei)\
**Post date:** [May 16, 2025, 12:05pm UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/3 "2025-05-16T12:05:23Z")

</div>

Hi @michivo, and welcome to the Auth0 Community!

It sounds like your redirect\_uri is not properly set to a page that is not protected with authorization, and the `createAuth0` function defaults to redirecting to app root (“/”).

Could you please check out [this](https://developer.auth0.com/resources/guides/spa/vue/basic-authentication#:~:text=Configure%20a%20Vue.js%20Authentication%20Plugin,-It%27s%20important%20to) doc, and confirm that you have configured the redirect\_uri as shown in the guide, please?

Sincerely,  
Teodor.

---

<div class="post-metadata">

**Author:** ![michivo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michivo/32/71229_2.png) [@michivo](https://community.auth0.com/u/michivo)\
**Post date:** [May 16, 2025, 3:09pm UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/4 "2025-05-16T15:09:03Z")

</div>

Thanks for the reply. I’m pretty sure that I’ve set up the redirect\_uri correctly. After signing in, the user is redirected to that URI, so I think that’s a good sign.  
The problem I have is that even without signing in, the user is redirected to /. All I do is call createAuth0(). At this point in time, I do not want any redirect to happen.

---

<div class="post-metadata">

**Author:** ![teodor.andrei](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/teodor.andrei/32/75320_2.png) [@teodor.andrei](https://community.auth0.com/u/teodor.andrei)\
**Post date:** [May 19, 2025, 7:45am UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/5 "2025-05-19T07:45:50Z")

</div>

As I can see from the [SDK](https://github.com/auth0/auth0-vue/blob/3173ef3a14b2179bf9efef491dd49a575a61a5e4/src/index.ts), it only tries to redirect if you are setting a redirect\_uri on the clientOptions prop. Can you please check that you are not setting it there, as it’s a deprecated feature?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/0/908b0967a0ad191cf9f9c2efe60dc2d7d34b0e52.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/4/b45995eef3bd7445c438b3d5561aeb746b0fbc00.png)

---

<div class="post-metadata">

**Author:** ![michivo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michivo/32/71229_2.png) [@michivo](https://community.auth0.com/u/michivo)\
**Post date:** [May 23, 2025, 7:49am UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/6 "2025-05-23T07:49:56Z")

</div>

No, I was not setting it on the client options, only on the autorizationParams.  
We’ve switched from @auth0/auth0-vue to @auth0/auth0-spa-js, built our own plugin, and now everything works as expected. Somehow auth0-vue was interfering with our routing in an unexpected way.

---

<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:** [June 6, 2025, 7:50am UTC](https://community.auth0.com/t/unexpected-redirect-to/186778/7 "2025-06-06T07:50:48Z")

</div>

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