-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
rehydratedState is defined only on INIT_ACTION. When localStorage is updated and then lazy-module is loaded, UPDATE_ACTION called and old state (rehydratedState from INIT) is used.
if ((action.type === INIT_ACTION || action.type === UPDATE_ACTION) && rehydratedState) { nextState = merge({}, nextState, rehydratedState); }
Use case:
- Login => token is saved in localstorage
- Reload the page => rehydratedState created with token
- Login with different user => new token stored in localstorage (but not synced with rehydratedState!)
- Go to lazy loaded page => UPDATE_ACTION, token is overridden with old token from step 2 :(((
BovineEnthusiast, demisx and mykolav
Metadata
Metadata
Assignees
Labels
No labels