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

supabase / auth / 41649064774
72%

Build:
DEFAULT BRANCH: master
Ran 03 Nov 2026 02:03PM UTC
Jobs 1
Files 208
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

03 Nov 2026 01:57PM UTC coverage: 71.661%. Remained the same
41649064774

push

github

web-flow
fix(models): exclude oauth client sessions from mfa step-up invalidation (#2801) (#2802)

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Closes #2801.

When a user completes an MFA verification (`verifyTOTPFactor`,
`verifyPhoneFactor`, `verifyWebAuthnFactor`, or `RecoveryCodesVerify`),
GoTrue calls `models.InvalidateSessionsWithAALLessThan(tx, user.ID,
models.AAL2.String())`.

The function executes:
```sql
DELETE FROM sessions WHERE user_id = ? AND aal < ?
```

Because OAuth 2.1 client sessions are issued at `AAL1` and cannot step
up to `AAL2`, any MFA verification by the user deletes all sessions
issued to third-party OAuth clients. Subsequent refresh attempts by
those clients fail with `refresh_token_not_found`.

## What is the new behavior?

`InvalidateSessionsWithAALLessThan` now excludes sessions associated
with an OAuth client:
```sql
DELETE FROM sessions WHERE user_id = ? AND aal < ? AND oauth_client_id IS NULL
```

OAuth client session lifecycles remain managed by consent revocation via
`RevokeOAuthSessions`.

## Additional context

Added unit test
`TestInvalidateSessionsWithAALLessThan_PreservesOAuthSessions` in
`internal/models/sessions_test.go`. The test asserts that:
1. Standard browser AAL1 sessions are invalidated on step-up.
2. OAuth client sessions (`oauth_client_id` present) are preserved.
3. Higher-assurance AAL2 sessions are preserved.

Co-authored-by: Cemal Kılıç <cemalkilic@users.noreply.github.com>

1 of 1 new or added line in 1 file covered. (100.0%)

16712 of 23321 relevant lines covered (71.66%)

496.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 41649064774.1 03 Nov 2026 02:03PM UTC 208
71.66
GitHub Action Run
Source Files on build 41649064774
  • Tree
  • List 208
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ae468cab on github
  • Prev Build on master (#41647899148)
  • Next Build on master (#41681861952)
  • 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