I am experimenting with meteor/account-base package and so far it is working really good. Although, I couldn't quite figure out how to add a remember me functionality.
I managed to change the token expiration date with the code Accounts.config({ loginExpirationInDays: 30 });
but I couldn't find any config like "do not save the token".
I saw the only forum post about this issue but I think it is outdated; most of the functions do not exist anymore like Accounts._unstoreLoginToken();
.
I also find the remember-me package but I am still looking for any built-in feature to do that. I don't want to add another dependency for something so simple like "remember me".
Is there any way to implement remember me option without any external package?
Thank you.
The Accounts package has no "remember me" functionality. By default, the Accounts package will remember previously logged in users because it stores the login token in the local storage of the user's browser.
However, you can remove the login token when a user leaves the page if they don't check the "Remember Me" checkbox by using localStorage.removeItem('Meteor.loginToken')
.