Auth State clearing on page refresh #351
-
Hi all. I've got a Nuxt SPA powered by a Laravel backend, using this config for the plugin:
I can login ok, but whenever I refresh the page in the browser I get logged out again. I am using cookie auth so the cookie should persist when refreshing the page. Anyone know what I am doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @JoshPJackson! The problem is in |
Beta Was this translation helpful? Give feedback.
Hey @JoshPJackson! The problem is in
initialRequest: false
, it should betrue
if you want to automatically fetch user identity on page refresh (plugin initialisation). You should disableinitialRequest
only when you need to control the order of plugins loading, more details can be found here - Plugin dependencies.