Skip to content

Commit

Permalink
references lynndylanhurley#200
Browse files Browse the repository at this point in the history
  • Loading branch information
lynndylanhurley committed Oct 27, 2015
1 parent 9927d3c commit 0620c9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -106,8 +106,6 @@ def update_auth_header

end

sign_out(@resource)

end

def resource_class(m=nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
<pre id="text">
</pre>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion lib/devise_token_auth/url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def self.generate(url, params = {})
return res
end

end
end

0 comments on commit 0620c9b

Please sign in to comment.