Strapi Login logout after page refresh
See original GitHub issueI am having trouble keeping $strapi.user persistent. I can login fine and cookies and local storage is also set, but upon a page request the user gets logged out straight away.
Is this expected behaviour?
I have tried following:
strapi: {
url: "http://localhost:8086",
key: 'authi_jwt',
expires: '1d',
cookie: {}
},
To keep the session from expiring …
Issue Analytics
- State:
- Created 2 years ago
- Comments:20
Top Results From Across the Web
Strapi Login logout after page refresh · Issue #138 - GitHub
I am having trouble keeping $strapi.user persistent. I can login fine and cookies and local storage is also set, but upon a page...
Read more >User Authentication with Next.js and Strapi
NextAuth is an authentication library built for use with Next.js. It's easy, fast, and secure. The code for this tutorial is available on...
Read more >User Authentication with Strapi and React
If the user already has an account, they'll need a login form to authenticate the application. You'll create a Sign-In page to handle...
Read more >Registration and Login (Authentication) with Vue.js and Strapi
Fill up the Reset password page input with the following url, http://localhost:8080/resetpassword . Click save, then go back. Getting our Edamam ...
Read more >How to Implement Authenticated API Requests to Strapi
Next, fill in the needed credentials to successfully log in to the ... Now, on the Settings page, access the Users & Permissions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tobias-srf I fixed this issue by completely clearing the application cache (I was using Google Chrome) and modifying my options object to the following:
Upon inspecting my Network tab when it would redirect me to /login and display I wasn’t logged in, I found some duplicate cookies which I’m assuming is what was causing the issue. I hope this helps!
Thank you! For me this worked. Setting an url to the strapi module fixed the issue. While local development the call to strapi was over localhost. Changing strapi’s url in nuxt config to http://127.0.0.1:1337 fixed it.
expires: '30d', url: http://127.0.0.1:1337, cookie: { path: '/', },