Skip to content

Accept Integer and Float remember-me timestamps from JSON - #5871

Open
afurm wants to merge 1 commit into
heartcombo:mainfrom
afurm:fix/rememberable-coerce-generated-at-timestamps
Open

afurm wants to merge 1 commit into
heartcombo:mainfrom
afurm:fix/rememberable-coerce-generated-at-timestamps

Conversation

@afurm

@afurm afurm commented Oct 15, 2026

Copy link
Copy Markdown

Summary

Rememberable only coerced String timestamps in remember_me?, while the Timeoutable hook already handles Integer last_request_at values. Cookie/session JSON can revive the remember timestamp as an Integer, a Float, or an integer-only numeric string, so a still-valid remember cookie was rejected.

This coerces Integer/Float with Time.at (same idea as Timeoutable) and accepts integer-only numeric strings in time_from_json.

Test plan

  • bundle exec ruby -Itest test/models/rememberable_test.rb → 23 runs, 0 failures

Rememberable only coerced String timestamps, while Timeoutable already
handles Integer last_request_at values. Cookie/session JSON can revive
the remember timestamp as Integer, Float, or an integer-only string, so
remember_me? failed even though the token was still valid. Coerce those
forms with Time.at, matching Timeoutable.
@afurm

afurm commented Oct 15, 2026

Copy link
Copy Markdown
Author

Hi! This is my first PR here, so the CI workflows are waiting for approval. Could a maintainer approve the run when you have a moment? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant