Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from thinkific/fix-cookie-compatibility-with-4.2
Browse files Browse the repository at this point in the history
fix-cookie-compatibility-with-4.2
  • Loading branch information
akiokio authored Apr 5, 2019
2 parents eced9b0 + 5ff2fe0 commit 067f4bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/devise/strategies/rememberable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ def valid?
# the record in the database. If the attempt fails, we pass to another
# strategy handle the authentication.
def authenticate!
resource = mapping.to.serialize_from_cookie(*remember_cookie)
remember_cookie # sets the instance variable
if @remember_cookie.length > 2
# safe, on this version we only care about the first two values
@remember_cookie = @remember_cookie[0..1]
end
resource = mapping.to.serialize_from_cookie(*@remember_cookie)

unless resource
cookies.delete(remember_key)
Expand Down

0 comments on commit 067f4bc

Please sign in to comment.