diff --git a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb index 027a9261a..52d3c1d00 100644 --- a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +++ b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb @@ -17,7 +17,7 @@ def set_request_start @used_auth_by_token = true # initialize instance variables - @token = DeviseTokenAuth::TokenFactory.new + @token ||= DeviseTokenAuth::TokenFactory.new @resource ||= nil @is_batch_request ||= nil end