Smooth out the finder API
This commit is contained in:
committed by
Stanko K.R.
parent
0ba43de61a
commit
caa4cd491e
@@ -59,8 +59,8 @@ module Authentication
|
||||
authorization_scheme, bearer_token = request.authorization.to_s.split(" ", 2)
|
||||
|
||||
if authorization_scheme == "Bearer" && bearer_token.present?
|
||||
if access_token = Identity::AccessToken.find_by(token: bearer_token)
|
||||
Current.identity = access_token.identity
|
||||
if identity = Identity.find_by_access_token(bearer_token)
|
||||
Current.identity = identity
|
||||
else
|
||||
head :unauthorized
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user