Auth-module: Nuxt Auth Not Redirecting

Created on 29 Dec 2020  路  1Comment  路  Source: nuxt-community/auth-module

I don't think this is a bug as I have this working in another project. I basically copied all the settings from that project to this one but I can NOT get the /login page to redirect to the /admin page. What I'm trying to have happen is if you go to /admin it redirects you to /login if you are not logged in, and once you do login it redirects you back to /admin.

When I login, the authentication goes through fine. /api/user gets called and that returns the user object exactly as expected. But it just stays on the /login page. And if I try putting in /admin into the URL it just redirects me back to the /login page.

Here's the repo. If you clone this and run it, you should see what I'm talking about. I setup the API so any username and password will work.
https://github.com/joshrouwhorst/NuxtAuthIssue

I'm somewhat new to Nuxt so maybe there is a troubleshooting step I'm unaware of. I appreciate any help!

question

Most helpful comment

Turns out the slightly more recent version of @nuxtjs/auth-next (5.0.0-1608568767.2fe2217) isn't working. I switched to the version in my working project (5.0.0-1607967355.df8f01e) and that works.

>All comments

Turns out the slightly more recent version of @nuxtjs/auth-next (5.0.0-1608568767.2fe2217) isn't working. I switched to the version in my working project (5.0.0-1607967355.df8f01e) and that works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

varna picture varna  路  4Comments

nilskoppelmann picture nilskoppelmann  路  3Comments

nikkanetiya picture nikkanetiya  路  3Comments

DiegoGallegos4 picture DiegoGallegos4  路  3Comments

javialon26 picture javialon26  路  3Comments