Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor user accounts if not selected remember me then logout on browser close?

I am using meteor user accounts for login . Now I have customized login forms and used their methods to login. Now i want to add remember me check box. If its not selected user should be logged out. Otherwise he can resume his session unless he manually log out. Any idea or concept what ever you can provide would be appreciated.

like image 449
Nishant Lad Avatar asked Nov 10 '22 13:11

Nishant Lad


1 Answers

Can not test this at the moment, but you could use onbeforeunload or onunload events, and process the logout in that step

window.onbeforeunload = function () {
    Meteor.logout();
};
like image 115
Alex Szabo Avatar answered Nov 15 '22 06:11

Alex Szabo