Cannot persist store during Nxt SSR

Asked 2 years ago, Updated 2 years ago, 66 views

I tried to copy this article, but the store was not persistent

Specifically, the middleware authenticates FirebaseAuth before page loading.
During authentication, the onAuthStateChanged function retrieves user information and stores it in the store.
However, when reloading, user information can be obtained only null, and even if it has been authenticated, it is not authenticated, so when reloading, it is authenticated with the contents of the store.
Please teach me the solution.

nuxt.js

2022-09-29 22:29

1 Answers

See the formula for easy implementation.

Below is a sample authentication screen for FirebaseAuth based on the formula, so
Please refer to it

https://github.com/Ittan888/nuxt-firebase-auth-sample


2022-09-29 22:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.