Handle everything in the same method
This commit is contained in:
committed by
Stanko K.R.
parent
895b0e13b8
commit
3329008dd8
@@ -59,6 +59,8 @@ module Authentication
|
||||
if request_authorized_by_bearer_token?
|
||||
if access_token = Identity::AccessToken.find_by(token: authorization_bearer_token)
|
||||
Current.identity = access_token.identity
|
||||
else
|
||||
head :unauthorized
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -72,15 +74,11 @@ module Authentication
|
||||
end
|
||||
|
||||
def request_authentication
|
||||
if request_authorized_by_bearer_token?
|
||||
head :unauthorized
|
||||
else
|
||||
if Current.account.present?
|
||||
session[:return_to_after_authenticating] = request.url
|
||||
end
|
||||
|
||||
redirect_to_login_url
|
||||
if Current.account.present?
|
||||
session[:return_to_after_authenticating] = request.url
|
||||
end
|
||||
|
||||
redirect_to_login_url
|
||||
end
|
||||
|
||||
def after_authentication_url
|
||||
|
||||
Reference in New Issue
Block a user