mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not allow revoking the token of current session. (#6472)
* FIX: Do not allow revoking the token of current session. * DEV: Add getter of current auth_token from Guardian.
This commit is contained in:
@@ -9,9 +9,7 @@ class UserAuthTokenSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def is_active
|
||||
cookie = scope.request.cookies[Auth::DefaultCurrentUserProvider::TOKEN_COOKIE]
|
||||
|
||||
UserAuthToken.hash_token(cookie) == object.auth_token
|
||||
scope.auth_token == object.auth_token
|
||||
end
|
||||
|
||||
def seen_at
|
||||
|
||||
Reference in New Issue
Block a user