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 6dff274a4..c3264a0ab 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 @@ -32,7 +32,7 @@ def set_user_by_token(mapping=nil) @client_id ||= 'default' # check for an existing user, authenticated via warden/devise - devise_warden_user = warden.user(rc.to_s.underscore.to_sym) + devise_warden_user = warden.user(rc.to_s.underscore.to_sym) if devise_warden_user && devise_warden_user.tokens[@client_id].nil? @used_auth_by_token = false @resource = devise_warden_user @@ -54,7 +54,7 @@ def set_user_by_token(mapping=nil) user = uid && rc.find_by_uid(uid) if user && user.valid_token?(@token, @client_id) - sign_in(:user, user, store: false, bypass: true) + sign_in(:user, user, store: false, bypass: false) return @resource = user else # zero all values previously set values @@ -106,8 +106,6 @@ def update_auth_header end - sign_out(@resource) - end def resource_class(m=nil) diff --git a/app/views/devise_token_auth/omniauth_external_window.html.erb b/app/views/devise_token_auth/omniauth_external_window.html.erb index 3992decb2..0739e4c6d 100644 --- a/app/views/devise_token_auth/omniauth_external_window.html.erb +++ b/app/views/devise_token_auth/omniauth_external_window.html.erb @@ -35,4 +35,4 @@
     
- \ No newline at end of file + diff --git a/lib/devise_token_auth/url.rb b/lib/devise_token_auth/url.rb index 172a22fd6..7614a86af 100644 --- a/lib/devise_token_auth/url.rb +++ b/lib/devise_token_auth/url.rb @@ -12,4 +12,4 @@ def self.generate(url, params = {}) return res end -end \ No newline at end of file +end