DEV Community

Discussion on: Redux-persist (v6) in detail (React)

Collapse
 
ssameghini profile image
Sebastián Sameghini

Hi!
What if I only want to persist the store after a user has authenticated?
For example, when someone visits my page an authentication check is made (token then session restored), but if no session is found, the page redirects to /login. PersistGate would delay the rendering of this page until a persist process completes, preventing anyone without credentials to access the page (in practice, no one access).

Collapse
 
bhatvikrant profile image
Vikrant Bhat

Dispatch your action only after verification