Closed kascote closed 6 years ago
Do you want something like this?
const validateSession = (session) => {
... // code to validate the session token
// returns a boolean (true if is valid or false otherwise)
}
sessionService.initSessionService(store, { validateSession });
If the session doesn't pass the validation then the session will be destroyed.
yeah!... if the function could be a promise better!
I imagine that checked
will be false while try to validate and true after done, and authenticated
will be true or false depending of the response.. make sense ?
Understood! It looks like a great feature! Thanks for come up with this, I'll definitely work on it.
Any news on this ? I'm facing this issue as well. Thanks !
@alduro was just added in version v2.4.0
When the page reload, initSessionService reload the token from the configured storage. But I need to validate the token. May be have some user defined promise to use on refreshFromLocalStorage before dispatch the getUserSessionX action.
Or there is another way to do it ?
ps: I'm not using SSR