feat(otp): write expires_at when creating one_time_tokens - #2766
Open
annabkr wants to merge 6 commits into
Open
Conversation
expires_at when creating one_time_tokens
expires_at when creating one_time_tokensexpires_at when creating one_time_tokens
annabkr
marked this pull request as ready for review
September 1, 2026 13:25
fadymak
approved these changes
Sep 1, 2026
fadymak
reviewed
Sep 1, 2026
Base automatically changed from
annabaker/auth-1552-add-expiresat-column-to-the-one_time_tokens-table
to
master
September 2, 2026 13:56
CreateOneTimeToken now takes the validity window and stores expires_at on insert. Call sites pass Mailer.OtpExp for email flows and Sms.OtpExp for phone flows, matching the windows the verify path infers from users.*_sent_at today. Reads are unchanged. Adds OtpExpAsDuration helpers on the mailer and SMS configurations. Existing tests are updated for the new signature.
Add a models suite covering persistence, past windows, and resend replacement, and an api suite asserting expires_at equals sent_at + OtpExp per channel. The api suite pins Mailer.OtpExp and Sms.OtpExp to different values so a swapped config field fails the test.
annabkr
force-pushed
the
annabaker/auth-1572-start-writing-to-one_time_tokensexpiresat
branch
from
September 2, 2026 13:56
ac7da1d to
fcaf26e
Compare
|
Found 1 test failure on Blacksmith runners: Failure
|
annabkr
force-pushed
the
annabaker/auth-1572-start-writing-to-one_time_tokensexpiresat
branch
from
September 2, 2026 20:42
14d855c to
fcaf26e
Compare
…-start-writing-to-one_time_tokensexpiresat
The test came in from master via merge after this branch added the validityDuration parameter, so the models package did not compile. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Write to the new
expires_atcolumn when creatingone_time_tokensWhat is the current behavior?
The column was added in #2765 , but it is not yet written to.
What is the new behavior?
We write to
expires_at, and have tests asserting expected behavior, but do not yet read from it.Additional context
See AUTH-1552.