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

kobotoolbox / kpi / 40515332401
59%
master: 76%

Build:
Build:
LAST BUILD BRANCH: release/2.026.43
DEFAULT BRANCH: master
Ran 27 Oct 2026 01:54PM UTC
Jobs 10
Files 933
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

27 Oct 2026 01:48PM UTC coverage: 83.641% (-0.001%) from 83.642%
40515332401

push

github

web-flow
fix(mfa): count TOTP activation as a fresh MFA authentication DEV-3189 (#7764)

### 📣 Summary
After turning on two-factor authentication, users now see their recovery
codes right away instead of being asked to sign in again.

### 📖 Description
When a user turned on two-factor authentication, the recovery codes
shown right after could ask them to confirm their identity again, even
though they had just entered a valid code from their authenticator app.
This mostly affected users who sign in with SSO only (no password), and
occasionally users who took close to 5 minutes to set up their app. The
code entered while turning on 2FA now counts as a fresh 2FA sign-in, so
the recovery codes are shown immediately.

### 💭 Notes
**The issue.** allauth only shows recovery codes if the user proved
their identity in the last `ACCOUNT_REAUTHENTICATION_TIMEOUT` (5 min).
It checks the latest entry in the session's authentication log. Turning
TOTP on doesn't add an entry, so:
- **SSO-only users:** with no password and no MFA, they have no way to
reauthenticate, so allauth lets them add TOTP without checking. One
second later they do have MFA, so `GET
.../authenticators/recovery-codes` returns 401 `mfa_reauthenticate` if
their SSO login was more than 5 minutes ago. The frontend then lands on
the `/account/reauthenticate/totp` placeholder (DEV-1971): 2FA is on,
but no codes are shown.
- **Password users:** same 401 if their password reauthentication
expires between confirming the code and fetching the codes. This is
rare.
- Users who already have MFA, and the legacy `/api/v2/auth/app/...`
endpoints (no reauth check, codes returned by `confirm`), are not
affected.
**The fix.** A receiver on allauth's `authenticator_added` signal
records a TOTP activation as an `mfa` authentication in the session
(`record_authentication`), the same entry allauth writes after a 2FA
reauthentication.
- **TOTP only:** recovery codes also fire `authenticator_added` but
don't count.
- **Doesn't b... (continued)

10753 of 14068 branches covered (76.44%)

6 of 9 new or added lines in 1 file covered. (66.67%)

694 existing lines in 43 files now uncovered.

34209 of 40900 relevant lines covered (83.64%)

5.52 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
45.63
7.33% kobo/apps/accounts/signals.py

Coverage Regressions

Lines Coverage ∆ File
93
42.11
-48.95% kobo/apps/openrosa/apps/api/viewsets/xform_list_api.py
83
45.68
-9.82% kobo/apps/openrosa/libs/utils/logger_tools.py
63
33.96
-59.43% kobo/apps/openrosa/apps/api/viewsets/briefcase_api.py
56
48.31
-47.46% kobo/apps/openrosa/apps/api/viewsets/xform_submission_api.py
52
57.0
7.0% kpi/utils/xml.py
37
51.22
-45.12% kobo/apps/openrosa/libs/serializers/xform_serializer.py
33
56.67
-36.67% kobo/apps/openrosa/libs/renderers/renderers.py
30
0.0
-75.0% kobo/apps/openrosa/apps/django_digest_backends/cache.py
27
34.0
-54.0% kobo/apps/data_collectors/authentication.py
22
47.87
4.27% kobo/apps/audit_log/models.py
20
43.9
-48.78% kobo/apps/openrosa/libs/filters.py
15
20.0
-60.0% kobo/apps/openrosa/apps/api/utils/xml.py
15
64.76
-7.62% kpi/utils/object_permission.py
14
54.03
1.61% kobo/apps/openrosa/apps/logger/signals.py
12
40.48
-7.14% kobo/apps/openrosa/apps/main/models/meta_data.py
12
52.56
-14.1% kpi/authentication.py
10
78.05
13.59% kobo/apps/openrosa/apps/logger/xform_instance_parser.py
10
55.0
0.0% kobo/apps/openrosa/libs/utils/middleware.py
8
63.57
7.86% kobo/apps/audit_log/signals.py
8
72.04
-2.37% kobo/apps/openrosa/apps/logger/models/xform.py
8
30.12
1.2% kpi/utils/storage.py
7
30.56
-6.48% kobo/apps/openrosa/apps/api/tools.py
6
31.25
-37.5% kobo/apps/openrosa/libs/utils/string.py
5
50.0
-50.0% kobo/apps/openrosa/libs/mixins/openrosa_headers_mixin.py
5
69.57
-21.74% kobo/apps/openrosa/libs/permissions.py
5
40.0
-50.0% kpi/utils/fuzzy_int.py
5
70.37
27.78% kpi/utils/mongo_helper.py
4
75.38
3.59% kobo/apps/openrosa/apps/logger/models/instance.py
4
41.94
-12.9% kobo/apps/openrosa/libs/authentication.py
4
0.0
-100.0% kobo/apps/openrosa/libs/utils/storage.py
3
57.26
-2.42% kobo/apps/openrosa/apps/logger/models/attachment.py
3
60.0
-30.0% kobo/apps/openrosa/libs/serializers/data_serializer.py
3
60.0
-30.0% kpi/mixins/mfa.py
2
66.67
-13.33% kobo/apps/openrosa/apps/viewer/signals.py
2
27.78
-5.56% kobo/apps/openrosa/libs/utils/decorators.py
1
50.0
-3.13% kobo/apps/accounts/mfa/utils.py
1
75.0
-25.0% kobo/apps/audit_log/mixins.py
1
92.86
32.14% kobo/apps/audit_log/utils.py
1
83.05
-1.69% kobo/apps/openrosa/apps/logger/exceptions.py
1
46.1
0.37% kobo/apps/openrosa/apps/viewer/models/data_dictionary.py
1
91.48
38.33% kpi/models/asset.py
1
52.97
9.59% kpi/renderers.py
1
75.0
-6.25% kpi/utils/drf_exceptions.py
Jobs
ID Job ID Ran Files Coverage
1 40515332401.1 27 Oct 2026 01:54PM UTC 928
52.91
2 40515332401.2 27 Oct 2026 01:54PM UTC 930
44.8
3 40515332401.3 27 Oct 2026 01:55PM UTC 930
54.13
4 40515332401.4 27 Oct 2026 01:55PM UTC 930
50.54
5 40515332401.5 27 Oct 2026 01:58PM UTC 931
68.77
6 40515332401.6 27 Oct 2026 02:00PM UTC 933
71.17
7 40515332401.7 27 Oct 2026 02:12PM UTC 928
43.54
8 40515332401.8 27 Oct 2026 02:12PM UTC 928
49.3
9 40515332401.9 27 Oct 2026 02:33PM UTC 928
58.36
10 40515332401.10 27 Oct 2026 02:45PM UTC 930
59.42
Source Files on build 40515332401
  • Tree
  • List 933
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 10e587dc on github
  • Prev Build on main (#40508718335)
  • Next Build on main (#40559252188)
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