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

supabase / gotrue / 8258879978
65%

Build:
DEFAULT BRANCH: master
Ran 13 Mar 2024 03:11AM UTC
Jobs 1
Files 114
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

13 Mar 2024 03:07AM UTC coverage: 65.308% (+0.04%) from 65.27%
8258879978

push

github

web-flow
feat: clean up expired factors (#1371)

## What kind of change does this PR introduce?

Currently, unverified MFA factors can build up in the database quickly.
Supabase developers can toggle Maximum unverified factors ( `Maximum
number of per-user MFA factors`) via the dashboard but developers will
have to look for the toggle. Developers can also call `unenroll` but it
requires an additional step.


This PR proposes periodic cleanup of stale factors on each request. A
stale factor is:

- Unverified
- Has no associated Challenges 
- Older than five minutes

Why five minutes? 
- Most enrolment or verification flow should be completed within the
five minute window

Factors which are unverified but have associated challenges will be
cleaned up [after the developer makes successful
verification](https://github.com/supabase/gotrue/blob/master/internal/api/mfa.go#L314)

Alternatives considered:
- Return the same factor and QR code if the same user calls `/enroll`
twice. We unfortunately can't reuse the QR code as it poses a security
risk.
- Increase the initial number of default unverified factors (currently
10)
- Drop the unverified factor check. I think this was initially
introduced to prevent a malicious user from creating excessive entries
in the database


Address #979.

---------

Co-authored-by: joel@joellee.org <joel@joellee.org>
Co-authored-by: joel <joel@joels-MacBook-Pro.local>

20 of 28 new or added lines in 3 files covered. (71.43%)

1 existing line in 1 file now uncovered.

7852 of 12023 relevant lines covered (65.31%)

60.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8258879978.1 13 Mar 2024 03:11AM UTC 0
65.31
GitHub Action Run
Source Files on build 8258879978
Detailed source file information is not available for this build.
  • Back to Repo
  • 5c942074 on github
  • Prev Build on master (#8257704520)
  • Next Build on master (#8264192556)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc