• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 35354476053
72%

Build:
DEFAULT BRANCH: master
Ran 18 Sep 2026 02:15PM UTC
Jobs 1
Files 207
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Sep 2026 02:09PM UTC coverage: 71.423% (+0.02%) from 71.401%
35354476053

push

github

web-flow
feat(otp): add one_time_tokens query helpers (#2797)

## What kind of change does this PR introduce?
Feature

## What is the current behavior?
There is no single-query lookup for a token hash and its
`pkce_`-prefixed form, and no lookup by `relates_to`.

Callers such as `FindUserByEmailChangeCurrentAndAudience` run two
`FindOneTimeToken` queries to cover the prefix, which is inefficient.

## What is the new behavior?
Adds two parent query methods used by the upcoming
OTT-as-source-of-truth work:
- `FindOneTimeTokenWithPKCEFallback`: single-query lookup that accepts
either an exact token hash or its `pkce_`-prefixed form, preferring the
exact match.
- `FindOneTimeTokenByRelatesTo`: looks up the newest token row for a
given `relates_to` value (e.g. phone number) and token type.

Along with:
- `PKCEPrefix` is now a constant in `models` that we reference vs.
string literals
- `FindOneTimeToken` and `FindOneTimeTokenWithPKCEFallback` now share
`findOneTimeToken`, guided by a `pkceFallback` flag.

Adds tests for those methods. Not updating existing callers for now to
reduce the radius of this change.

## Additional context
Contributes to AUTH-1553 but does not close.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

27 of 29 new or added lines in 1 file covered. (93.1%)

16498 of 23099 relevant lines covered (71.42%)

495.0 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
72.48
3.93% internal/models/one_time_token.go
Jobs
ID Job ID Ran Files Coverage
1 35354476053.1 18 Sep 2026 02:15PM UTC 207
71.42
GitHub Action Run
Source Files on build 35354476053
  • Tree
  • List 207
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • f8520b4a on github
  • Prev Build on master (#35318704867)
  • Next Build on master (#35368409400)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc