-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: MFA Enrollment (TOTP) #2238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/** | ||
* Returns the title text for the current step. | ||
* | ||
* This is a convenience method for providing default titles in custom UIs. | ||
*/ | ||
fun getStepTitle(): String = when (step) { | ||
MfaEnrollmentStep.SelectFactor -> "Choose Authentication Method" | ||
MfaEnrollmentStep.ConfigureSms -> "Set Up SMS Verification" | ||
MfaEnrollmentStep.ConfigureTotp -> "Set Up Authenticator App" | ||
MfaEnrollmentStep.VerifyFactor -> "Verify Your Code" | ||
MfaEnrollmentStep.ShowRecoveryCodes -> "Save Your Recovery Codes" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can move this into the enum class itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the strings should be localized
/** | ||
* Returns helper text for the current step. | ||
* | ||
* This is a convenience method for providing default instructions in custom UIs. | ||
*/ | ||
fun getStepHelperText(): String = when (step) { | ||
MfaEnrollmentStep.SelectFactor -> "Select a second authentication method to secure your account" | ||
MfaEnrollmentStep.ConfigureSms -> "Enter your phone number to receive verification codes" | ||
MfaEnrollmentStep.ConfigureTotp -> "Scan the QR code with your authenticator app" | ||
MfaEnrollmentStep.VerifyFactor -> when (selectedFactor) { | ||
MfaFactor.Sms -> "Enter the code sent to your phone" | ||
MfaFactor.Totp -> "Enter the code from your authenticator app" | ||
null -> "Enter your verification code" | ||
} | ||
MfaEnrollmentStep.ShowRecoveryCodes -> "Store these codes in a safe place. You can use them to sign in if you lose access to your authentication method." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can move this into the enum class itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the strings should be localized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Generate TOTP secret + QR URL; verify 6-digit code; store factor with clock drift tolerance.