From 8ef5bafc1a414d36c6219ed9dede21490556d4e4 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Tue, 27 Oct 2020 13:20:14 +0100 Subject: [PATCH] Revert "Init user session for devise controllers after token auth [SCI-5123]" --- app/controllers/concerns/token_authentication.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/concerns/token_authentication.rb b/app/controllers/concerns/token_authentication.rb index 1b87ffb9c..a6ed6d2cd 100644 --- a/app/controllers/concerns/token_authentication.rb +++ b/app/controllers/concerns/token_authentication.rb @@ -22,10 +22,7 @@ module TokenAuthentication Extends::API_PLUGABLE_AUTH_METHODS.each do |auth_method| method(auth_method).call - if current_user - sign_in(current_user) if devise_controller? - return true - end + return true if current_user end # Default token implementation @@ -36,7 +33,5 @@ module TokenAuthentication payload = Api::CoreJwt.decode(@token) @current_user = User.find_by(id: payload['sub']) raise JWT::InvalidPayload, I18n.t('api.core.no_user_mapping') unless current_user - - sign_in(current_user) if devise_controller? end end