Just to have some background. Nuxt set to SPA, both on the same hostname (changed it so that Nuxt triggers same address + /api).
The page does work fine and I can move around.
If I register, it will validate my requests and create an account for me to log in.
HOWEVER, if I log out, or just create a new page and try to get on the page again, I will not be able to go through /login page.
Network tab told me that I succesfully got the token from /login POST, but didnt get the user from /user POST, instead it says:
error: "Already authenticated."
This message is sent by RedirectIfAuthenticated backend middleware.
What do I need to change to make it so people could log in after they register too?
User should be automatically logged in after registration. Can you check which api calls and Vuex actions are called? Maybe in vue dev tools you can find out if the FETCH_USER action did fail?
Just to have some background. Nuxt set to SPA, both on the same hostname (changed it so that Nuxt triggers same address + /api). The page does work fine and I can move around. If I register, it will validate my requests and create an account for me to log in.
HOWEVER, if I log out, or just create a new page and try to get on the page again, I will not be able to go through /login page. Network tab told me that I succesfully got the token from /login POST, but didnt get the user from /user POST, instead it says:
error: "Already authenticated."
This message is sent by RedirectIfAuthenticated backend middleware.
What do I need to change to make it so people could log in after they register too?