Skip to content

Commit

Permalink
added bypass_sign_in for next version of Devise
Browse files Browse the repository at this point in the history
  • Loading branch information
KendallPark committed Jun 17, 2016
1 parent bc04747 commit a9294f8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ 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 with bypass: true will be deprecated in the next version of Devise
if self.respond_to? :bypass_sign_in
bypass_sign_in(user, scope: :user)
else
sign_in(:user, user, store: false, bypass: true)
end
return @resource = user
else
# zero all values previously set values
Expand Down

0 comments on commit a9294f8

Please sign in to comment.