Thank you! Strange that it didn't work as it is almost a full copy of auth middleware, but glad you got it resolved (:
In my setup there are login and signup pages, but it's up to you how to organize your site.
It was because of rehydration errors, not matching content on server and client side, and by enabling this middleware client side only it solved the issues. if (!process.client) return; is the only change. Not DRY, I know (:
In near days I am going to hunt one more bug, will update the post after I fix that(axios dynamic base url not used, it requests local server and not the remote one).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great Post. One issue.
middleware: ["loggedIn"] in nuxt.config not working for me :(
if i set middleware: ["auth"] in nuxt.config that working.
i want to all site rrquired authenticaion without login + signup page
Thank you! Strange that it didn't work as it is almost a full copy of auth middleware, but glad you got it resolved (:
In my setup there are login and signup pages, but it's up to you how to organize your site.
Thanks for quick reply :)
I don't understand why you use middleware: ["loggedIn"] :(
Can you please explain easyway. If you don't mind :)
Thanks
It was because of rehydration errors, not matching content on server and client side, and by enabling this middleware client side only it solved the issues.
if (!process.client) return;
is the only change. Not DRY, I know (:In near days I am going to hunt one more bug, will update the post after I fix that(axios dynamic base url not used, it requests local server and not the remote one).