1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-02 09:43:29 +00:00
Files
browser/apps/web/src/app/auth/recover-two-factor.component.html
rr-bw ec950853bc fix(2fa-recovery-code-error): [Auth/PM-19885] Better error handling when 2FA recovery code is invalid (#16145)
Implements better error handling when a user enters an invalid 2FA recovery code. Upon entering an invalid code:
- Keep the user on the `/recover-2fa` page (This also makes it so the incorrect code remains in the form field so the user can see what they entered, if they mistyped the code, etc.)
- Show an inline error: "Invalid recovery code"
2025-08-29 12:25:31 -07:00

40 lines
1.2 KiB
HTML

<form [formGroup]="formGroup" [bitSubmit]="submit">
<p bitTypography="body1">
{{ recoveryCodeMessage }}
<a
bitLink
href="https://bitwarden.com/help/lost-two-step-device/"
target="_blank"
rel="noreferrer"
>{{ "learnMore" | i18n }}</a
>
</p>
<bit-form-field>
<bit-label>{{ "emailAddress" | i18n }}</bit-label>
<input
bitInput
type="text"
formControlName="email"
appAutofocus
inputmode="email"
appInputVerbatim="false"
/>
</bit-form-field>
<bit-form-field>
<bit-label>{{ "masterPass" | i18n }}</bit-label>
<input bitInput type="password" formControlName="masterPassword" appInputVerbatim />
</bit-form-field>
<bit-form-field>
<bit-label>{{ "recoveryCodeTitle" | i18n }}</bit-label>
<input bitInput type="text" formControlName="recoveryCode" appInputVerbatim />
</bit-form-field>
<div class="tw-flex tw-gap-2">
<button type="submit" bitButton bitFormButton buttonType="primary" [block]="true">
{{ "submit" | i18n }}
</button>
<a bitButton buttonType="secondary" routerLink="/login" [block]="true">
{{ "cancel" | i18n }}
</a>
</div>
</form>