meteor-stale-session icon indicating copy to clipboard operation
meteor-stale-session copied to clipboard

Allow disabling for a user

Open evan-coygo opened this issue 5 years ago • 0 comments

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});

evan-coygo avatar May 23 '19 17:05 evan-coygo