Skip to content

Conversation

Lyokone
Copy link
Contributor

@Lyokone Lyokone commented Oct 10, 2025

Generate TOTP secret + QR URL; verify 6-digit code; store factor with clock drift tolerance.

Comment on lines 162 to 173
/**
* 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"
}
Copy link

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?

Copy link

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

Comment on lines 175 to 190
/**
* 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."
}
Copy link

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?

Copy link

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

Copy link

@demolaf demolaf left a comment

Choose a reason for hiding this comment

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

LGTM

@Lyokone Lyokone enabled auto-merge (squash) October 10, 2025 11:18
@Lyokone Lyokone merged commit 72ad750 into version-10.0.0-dev Oct 10, 2025
5 checks passed
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