Skip to content

Add MFA enroll, disable, and login verification - #16

Merged
gjong merged 4 commits into
mainfrom
cursor/mfa-enroll-verify-25b7
Jul 27, 2026
Merged

Add MFA enroll, disable, and login verification#16
gjong merged 4 commits into
mainfrom
cursor/mfa-enroll-verify-25b7

Conversation

@gjong

@gjong gjong commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Second slice of the auth epic (roadmap #34), following merged PR #15 (API token sessions).

  • Detect PRE_VERIFICATION_USER JWTs after password login and hold them in memory (PendingMfaSession) until POST …/verify-2-factor succeeds — only then call activateSession.
  • Login OTP screen (Screen.Verify2Factor) with system-back clearing pending MFA.
  • Settings → MFA setup: QR enroll/enable (GET/PATCH …/2-factor) and confirmed disable; Settings MFA subtitle refreshes on resume.
  • Typed DTOs, interceptor exception for explicit verify Authorization, en/nl/de strings, design + ADR-021.

Still deferred: OIDC / AppAuth / .well-known consumption.

Design

  • docs/design/mfa-enroll-verify.md
  • docs/adr/021-mfa-enroll-verify.md

Test plan

  • Unit tests: ./gradlew testDebugUnitTest --no-daemon (pass)
  • Lint: ./gradlew lintDebug --no-daemon
  • Assemble: ./gradlew assembleDebug --no-daemon
  • Login with MFA-enabled account → OTP screen → dashboard
  • Login without MFA → dashboard (unchanged)
  • Settings → MFA: enroll with authenticator; disable with confirm
  • Invalid OTP shows error; back/system back clears pending MFA
Open in Web Open in Cursor 

cursoragent and others added 4 commits July 27, 2026 19:53
Adds design note and ADR-021 for pending pre-verification JWT handling,
verify-2-factor login challenge, and Settings QR enroll/disable. Updates
ARCHITECTURE and ADR-020 follow-ups.

Co-authored-by: Gerben Jongerius <gjong@users.noreply.github.com>
Detect PRE_VERIFICATION_USER JWTs after password login and hold them in
memory until verify-2-factor succeeds, then activate the full session.
Settings gains QR enroll/enable and confirmed disable via the 2-factor API.

Co-authored-by: Gerben Jongerius <gjong@users.noreply.github.com>
Use RequestBody for verify interceptor test and match CurrencyRepository.sync
return type in Verify2FactorViewModelTest.

Co-authored-by: Gerben Jongerius <gjong@users.noreply.github.com>
Clear pending MFA on system back, refresh Settings MFA status on resume,
show an error/retry state when profile load fails on MFA setup, keep
pending credentials after invalid OTP, and parse JWT roles with Moshi.

Co-authored-by: Gerben Jongerius <gjong@users.noreply.github.com>
@cursor
cursor Bot changed the base branch from cursor/api-token-sessions-25b7 to main July 27, 2026 19:53
@cursor
cursor Bot force-pushed the cursor/mfa-enroll-verify-25b7 branch from 62061a4 to cbd8278 Compare July 27, 2026 19:53
@gjong
gjong marked this pull request as ready for review July 27, 2026 19:56

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking review: Cursor Security Agent completed as skipped, so this PR is not auto-approved. Cursor Bugbot was not present; human review is needed before merge.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@gjong
gjong merged commit 36d7dfb into main Jul 27, 2026
4 checks passed
@gjong
gjong deleted the cursor/mfa-enroll-verify-25b7 branch July 27, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants