Skip to content

Rails8/ Routes#2

Open
olvado wants to merge 3 commits into
masterfrom
rails8/routes
Open

Rails8/ Routes#2
olvado wants to merge 3 commits into
masterfrom
rails8/routes

Conversation

@olvado

@olvado olvado commented Apr 21, 2026

Copy link
Copy Markdown
Member

chore(routes): remove :resend_code from only args for Rails 8 compatibility

olvado added 3 commits April 21, 2026 13:59
…stamp

ROTP >= 3 returns TOTP#verify as an Integer Unix epoch (timecode * interval)
rather than a boolean. authenticate_totp assigned that raw Integer straight to
totp_timestamp. When the consuming app backs totp_timestamp with a datetime
column, ActiveModel 8.1 passes the Integer through unchanged and Postgres
raises PG::DatetimeFieldOverflow on save.

Wrap the epoch in Time.at(...).utc before assignment. Replay protection is
preserved: ROTP calls #to_i on the value read back from the column, which
yields the same epoch for a Time/TimeWithZone. confirm_totp_secret funnels
through authenticate_totp, so it is covered by the same change.
Rails 8 no longer bundles Sprockets, so requiring sprockets/railtie (and the
config.assets.* settings that depend on it) aborted environment boot. Drop
them from the dummy app; these specs do not exercise the asset pipeline.

Zeitwerk also expects lib/sms_provider.rb to define SmsProvider, but the file
and its references use SMSProvider, so autoloading raised NameError in the
global before(:each) hook. Register SMS as an inflection acronym.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant