User Data Lost on Refresh
See original GitHub issueHello!
I am running a Nuxt project with Strapi backend, and am updating it to work with this new module. However, I am having issues managing the authentication flow.
The Issue
Logging in and navigating the app works fine, but since Nuxt is rendered server side, if I refresh the page the data stored in $strapi.user
is lost.
Is there a correct way to implement this module to avoid this happening? Previous to using this module, I used a VueX store and cookies, and then used nuxtServerInit()
to fetch the data from the Cookie and commit it to the user. WOndering if there is a way to avoid doing this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
system refresh and my lost data files - Microsoft Community
I got the computer back, but all my data files seem missing / disappeared. I AM very careful NOT to choose RESET, but...
Read more >User Data Lost on Refresh #31 - nuxt-modules/strapi - GitHub
Hello! I am running a Nuxt project with Strapi backend, and am updating it to work with this new module. However, I am...
Read more >Losing Context Data on Page Refresh - Stack Overflow
Then I call the recipe ID down from context in my RecipeInfoPage.js file to make the necessary API call, this is the page...
Read more >How to Save State to LocalStorage & Persist on Refresh with ...
To do this we'll use localStorage, a native API in browsers, that let's us store data. When we run our localStorage functions, we...
Read more >How To Reload Current Page Without Losing Any Form Data ...
The easiest way to reload current page without losing any form data in Javascript is to use the localStorage .
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
Thanks @sandiprb! Looks like this solves the issue! Thanks!
Hi, I noticed that $strapi.login does populate and return a full user object (if your user has relations, most of the will be returned as full objects as well)
But $strapi.fetchUser doesn’t Within your dashboard.vue / or whatever route to the user dashboard you can add your wanted object to create a full strapi user object again