FEATURE: logging out logs you out everywhere

can be disabled by changing the setting "log_out_strict" to false
This commit is contained in:
Sam
2015-01-28 12:56:25 +11:00
parent b003c2b4f3
commit 3483c8318f
4 changed files with 8 additions and 1 deletions

View File

@@ -82,6 +82,11 @@ class Auth::DefaultCurrentUserProvider
end
def log_off_user(session, cookies)
if SiteSetting.log_out_strict && (user = current_user)
user.auth_token = nil
user.save!
MessageBus.publish "/logout", user.id, user_ids: [user.id]
end
cookies[TOKEN_COOKIE] = nil
end