Closed abhirakshit closed 5 years ago
Hello!
You don't miss anything. This plugin does not save userId or token in storage, because it is supposed to be universal for node, browser or something else.
And you are free to make your own saving policy by that. For example you can use browser's localStorage for that. You can save token and if there is a a token being saved in localStorage do the code bellow before anything else on page load:
let token = localStorage.getItem('token');
...
try {
await server.login({resume:token});
} catch (e) {
// failed auth by token
}
Or you can make something more complex and save username, password, use plugin's events like loginResumeFailed
when auto-resume has failed and etc.
Thanks a lot. This works for me as I am already storing the user auth data in the Vue store.
Hello,
I have a Vue project which I am connecting with my Meteor server. I am seeing a weird issue that after a page refresh both the "server.userId" and "server.token" fields become undefined and the server throws logged out exception on method calls.
I have tried to manually set these fields after persisting the fields locally in the vue store. Is there some kind of setting I am missing which is causing this behavior.
Regards,