Smooth out the finder API

This commit is contained in:
David Heinemeier Hansson
2025-12-02 12:47:00 +01:00
committed by Stanko K.R.
parent 0ba43de61a
commit caa4cd491e
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -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