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

kobotoolbox / kpi / 43900467900
86%
master: 76%

Build:
Build:
LAST BUILD BRANCH: release/2.026.43
DEFAULT BRANCH: master
Ran 16 Nov 2026 03:53PM UTC
Jobs 10
Files 891
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

16 Nov 2026 03:48PM UTC coverage: 86.022% (+0.02%) from 86.007%
43900467900

push

github

web-flow
feat(mfa): require a 2FA code to change the password or turn 2FA off DEV-3258 (#7884)

### 📣 Summary
Accounts with two-factor authentication now need a 2FA code to change
their password or to turn 2FA off.

### 📖 Description
- **Changing the password** (`PATCH /me/`): when 2FA is on, a valid 2FA
code (authenticator or recovery code, including codes from the former
2FA system) is required in a new `mfa_code` field, alongside
`current_password`. A missing or wrong code is rejected with a 400. The
code is checked last, so a request rejected for another reason does not
use up a recovery code.
- **Turning 2FA off** (`DELETE
/api/v2/allauth/{client}/v1/account/authenticators/totp`): requires a
recent re-authentication done with a 2FA code; the password is not asked
for. allauth's `DELETE` takes no request body, so the code the user
enters only reaches the backend through the re-authentication step
(`/auth/2fa/reauthenticate`), and allauth's default check accepts any
recent re-authentication, whichever method was used. The backend now
checks that the re-authentication was done with a 2FA code, so the
endpoint enforces the rule itself rather than relying on the frontend.
Until then it answers with allauth's 401 re-authentication response.
- Regenerating recovery codes is unchanged.
- Endpoints that bypass these rules are no longer available:
- allauth's password change:
`/api/v2/allauth/{client}/v1/account/password/change` and
`/accounts/password/change/`
- allauth's templated 2FA deactivation page:
`/accounts/2fa/totp/deactivate/`
  - the legacy `POST /api/v2/auth/app/deactivate/`
- `/accounts/password/change/` and `/accounts/2fa/totp/deactivate/` keep
their route names, which allauth reverses internally, and now redirect
to `/#/account/security`.

**Dependency**: This PR should be merged after #7826.

10940 of 13750 branches covered (79.56%)

11 of 24 new or added lines in 6 files covered. (45.83%)

378 existing lines in 24 files now uncovered.

34212 of 39771 relevant lines covered (86.02%)

5.82 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
36.32
-0.15% kpi/serializers/current_user.py
5
34.43
2.76% kobo/apps/accounts/reauthentication.py
2
63.24
-0.67% kobo/apps/accounts/views.py

Coverage Regressions

Lines Coverage ∆ File
116
48.31
-26.07% kobo/apps/audit_log/models.py
80
23.66
-61.07% kobo/apps/openrosa/apps/logger/utils/instance.py
59
0.0
-95.16% kobo/apps/long_running_migrations/jobs/0015_fix_duplicate_organizations.py
31
63.57
-22.14% kobo/apps/audit_log/signals.py
14
0.0
-66.67% kobo/apps/beat/schedulers.py
14
56.25
-29.17% kobo/apps/hook/serializers/v2/hook.py
13
67.74
-20.97% kobo/apps/hook/models/hook.py
10
81.82
-12.99% kobo/apps/audit_log/base_views.py
8
57.26
-6.45% kobo/apps/openrosa/apps/logger/models/attachment.py
4
85.51
-5.8% hub/models/extra_user_detail.py
4
44.12
-11.76% kobo/apps/accounts/mfa/admin.py
4
59.32
-6.78% kobo/apps/hook/views/v2/hook.py
3
49.15
-5.08% hub/admin/password_validation.py
3
60.0
-15.0% kobo/apps/accounts/mfa/signals.py
3
78.43
-5.88% kobo/apps/kobo_auth/models.py
2
90.0
-10.0% kobo/apps/kobo_scim/admin.py
2
73.74
-1.01% kobo/apps/openapi_validator/middleware.py
2
76.72
-1.06% kobo/apps/openrosa/apps/logger/models/instance.py
1
42.79
-0.45% hub/admin/extend_user.py
1
35.59
-1.69% kobo/apps/accounts/mfa/utils.py
1
34.43
2.76% kobo/apps/accounts/reauthentication.py
1
63.24
-0.67% kobo/apps/accounts/views.py
1
89.47
-5.26% kobo/apps/audit_log/middleware.py
1
88.89
-11.11% kobo/apps/long_running_migrations/admin.py
Jobs
ID Job ID Ran Files Coverage
1 43900467900.1 16 Nov 2026 03:53PM UTC 886
54.45
2 43900467900.2 16 Nov 2026 03:54PM UTC 886
50.06
3 43900467900.3 16 Nov 2026 03:55PM UTC 886
57.45
4 43900467900.4 16 Nov 2026 03:55PM UTC 886
59.5
5 43900467900.5 16 Nov 2026 03:55PM UTC 888
59.03
6 43900467900.6 16 Nov 2026 03:55PM UTC 888
51.42
7 43900467900.7 16 Nov 2026 03:56PM UTC 889
66.52
8 43900467900.8 16 Nov 2026 03:56PM UTC 888
55.78
9 43900467900.9 16 Nov 2026 03:58PM UTC 891
69.04
10 43900467900.10 16 Nov 2026 03:58PM UTC 888
60.67
Source Files on build 43900467900
  • Tree
  • List 891
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 8487dc06 on github
  • Prev Build on main (#43894151464)
  • Next Build on main (#43904972394)
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