meteor-stale-session
meteor-stale-session copied to clipboard
Allow disabling for a user
If an application wants to allow users to disable this on a per-user basis it's currently not possible. Something like this would be helpful
meteorStaleSession.disableForUser(userId);
which could update the user document with a property that signals not to include them in the auto logout interval, so this query could be updated from
Meteor.users.update({heartbeat: {$lt: overdueTimestamp}},
{$set: {'services.resume.loginTokens': []},
$unset: {heartbeat:1}},
{multi: true});
to something like this
Meteor.users.update({heartbeat: {$lt: overdueTimestamp}, staleSession: { enabled: { $eq: true }}},
{$set: {'services.resume.loginTokens': []},
$unset: {heartbeat:1}},
{multi: true});