Page MenuHomePhabricator

Display recovery codes when setting up the user's first 2FA method, regardless of type
Closed, ResolvedPublic

Description

Currently we display recovery codes when setting up a TOTP method, but not when setting up a WebAuthn method. Once T232336: Separate recovery codes into a separate 2FA module is done, recovery codes will be independent of TOTP, and should be generated and displayed to the user when they set up their first method, regardless of whether it's TOTP or WebAuthn. This requires (conditionally) adding recovery code display to the WebAuthn setup flow, and conditionally removing it from the TOTP setup flow if the user already has recovery codes.

  • Display recovery codes when the user sets up their first 2FA method, whether it's TOTP or WebAuthn
  • Display existing recovery codes if the user already has them

Event Timeline

There will be a hook or something available to do this for both OATH and external modules, likely as a part of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/OATHAuth/+/1182964, as it progresses.

sbassett changed the task status from Open to In Progress.Sep 19 2025, 10:00 PM
sbassett claimed this task.
sbassett triaged this task as Medium priority.
sbassett added a project: user-sbassett.

There will be a hook or something available to do this for both OATH and external modules...

It will actually be a trait available to any class that extends OATHAuthOOUIHTMLForm. This is mostly finished for TOTP, though still needs to be added for WebAuthn at some point.

sbassett updated the task description. (Show Details)
sbassett moved this task from In Progress to Done on the user-sbassett board.