knubie
knubie

Reputation: 231

Log out a user from the server

Is there any way to log out a user (or all users) from the server? Basically I'm trying to log out all users every time the meteor server starts up or restarts.

Upvotes: 5

Views: 2211

Answers (1)

Tarang
Tarang

Reputation: 75945

You could clear up all the loginTokens which would force everyone to log back in

Meteor.users.update({}, {$set: { "services.resume.loginTokens" : [] }});

What this does is it clear's each users loginTokens so that they wont match up if the user tries to log in, then they would have to log back in. To alter who to target change the initial query (currently {})

Upvotes: 16

Related Questions