fix(accountsetup): show 2-Step Verification link before app-password link for Gmail (#166)

2-Step Verification is a prerequisite for Gmail's app-passwords page, so
render the twoFactorHelpUrl button first when present, then the
appPasswordHelpUrl button. Previously the prerequisite link rendered
second, so a user without 2FA enabled would hit a dead end on the first
button before noticing the second. No visible change for Yahoo/iCloud,
which have no twoFactorHelpUrl.

Closes #152

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit was merged in pull request #166.
This commit is contained in:
Jason Ross
2026-07-02 22:42:37 +00:00
committed by GitHub
co-authored by Claude Opus 4.8 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent a48d68c139
commit 97d6f9303b
@@ -151,23 +151,23 @@ fun AppPasswordSetupScreen(
)
Spacer(Modifier.height(12.dp))
OutlinedButton(
onClick = { openUrl(provider.appPasswordHelpUrl) },
modifier = Modifier.fillMaxWidth(),
) {
Text(stringResource(R.string.app_password_open_page, provider.displayName))
}
// Only Gmail has a two-factor prerequisite (see MailProvider.twoFactorHelpUrl): its
// app-passwords page rejects accounts without 2-Step Verification, so give those users
// a way to set it up instead of a dead end.
// app-passwords page rejects accounts without 2-Step Verification, so point users
// there first instead of sending them to the app-passwords page's dead end.
provider.twoFactorHelpUrl?.let { twoFactorHelpUrl ->
Spacer(Modifier.height(8.dp))
OutlinedButton(
onClick = { openUrl(twoFactorHelpUrl) },
modifier = Modifier.fillMaxWidth(),
) {
Text(stringResource(R.string.app_password_2fa_help))
}
Spacer(Modifier.height(8.dp))
}
OutlinedButton(
onClick = { openUrl(provider.appPasswordHelpUrl) },
modifier = Modifier.fillMaxWidth(),
) {
Text(stringResource(R.string.app_password_open_page, provider.displayName))
}
Spacer(Modifier.height(20.dp))