1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-09 05:57:40 +02:00
bitwarden-browser/apps/web/src/app/auth/two-factor.component.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

156 lines
5.5 KiB
HTML
Raw Normal View History

<form
#form
(ngSubmit)="submit()"
[appApiAction]="formPromise"
class="container"
ngNativeValidate
autocomplete="off"
>
2018-06-11 17:43:10 +02:00
<div class="row justify-content-md-center mt-5">
<div
class="col-5"
2019-02-21 22:50:37 +01:00
[ngClass]="{
2021-12-17 15:57:11 +01:00
'col-9':
2019-02-21 22:50:37 +01:00
selectedProviderType === providerType.Duo ||
selectedProviderType === providerType.OrganizationDuo
2018-06-11 17:43:10 +02:00
}"
2021-12-17 15:57:11 +01:00
>
2018-06-11 17:43:10 +02:00
<p class="lead text-center mb-4">{{ title }}</p>
2019-02-21 22:50:37 +01:00
<div class="card d-block">
<div class="card-body">
<ng-container
*ngIf="
selectedProviderType === providerType.Email ||
2018-06-11 17:43:10 +02:00
selectedProviderType === providerType.Authenticator
2019-02-21 22:50:37 +01:00
"
2018-06-11 17:43:10 +02:00
>
2021-03-16 17:44:31 +01:00
<p *ngIf="selectedProviderType === providerType.Authenticator">
2018-06-11 17:43:10 +02:00
{{ "enterVerificationCodeApp" | i18n }}
2021-12-17 15:57:11 +01:00
</p>
2018-06-11 17:43:10 +02:00
<p *ngIf="selectedProviderType === providerType.Email">
{{ "enterVerificationCodeEmail" | i18n : twoFactorEmail }}
2021-03-16 17:44:31 +01:00
</p>
2018-06-11 17:43:10 +02:00
<div class="form-group">
<label for="code" class="sr-only">{{ "verificationCode" | i18n }}</label>
<input
id="code"
type="text"
2019-02-21 22:50:37 +01:00
name="Code"
class="form-control"
[(ngModel)]="token"
required
appAutofocus
inputmode="tel"
appInputVerbatim
2021-12-17 15:57:11 +01:00
/>
2019-02-21 22:50:37 +01:00
<small class="form-text" *ngIf="selectedProviderType === providerType.Email">
2021-12-17 15:57:11 +01:00
<a
href="#"
2018-06-11 17:43:10 +02:00
appStopClick
2021-03-16 17:44:31 +01:00
(click)="sendEmail(true)"
[appApiAction]="emailPromise"
*ngIf="selectedProviderType === providerType.Email"
2019-10-11 17:22:21 +02:00
>
{{ "sendVerificationCodeEmailAgain" | i18n }}
2018-06-11 17:43:10 +02:00
</a>
2018-06-05 21:02:53 +02:00
</small>
</div>
2018-06-11 17:43:10 +02:00
</ng-container>
<ng-container *ngIf="selectedProviderType === providerType.Yubikey">
<p class="text-center">{{ "insertYubiKey" | i18n }}</p>
<picture>
2022-01-10 14:50:54 +01:00
<source srcset="../../images/yubikey.avif" type="image/avif" />
<source srcset="../../images/yubikey.webp" type="image/webp" />
<img src="../../images/yubikey.jpg" class="rounded img-fluid mb-3" alt="" />
</picture>
2018-06-11 17:43:10 +02:00
<div class="form-group">
<label for="code" class="sr-only">{{ "verificationCode" | i18n }}</label>
2021-12-17 15:57:11 +01:00
<input
2019-02-21 22:50:37 +01:00
id="code"
type="password"
name="Code"
class="form-control"
[(ngModel)]="token"
2021-12-17 15:57:11 +01:00
required
2019-02-21 22:50:37 +01:00
appAutofocus
appInputVerbatim
autocomplete="new-password"
2021-12-17 15:57:11 +01:00
/>
</div>
2018-06-11 17:43:10 +02:00
</ng-container>
2021-03-16 17:44:31 +01:00
<ng-container *ngIf="selectedProviderType === providerType.WebAuthn">
<div id="web-authn-frame" class="mb-3">
<iframe id="webauthn_iframe"></iframe>
2021-12-17 15:57:11 +01:00
</div>
2018-06-11 17:43:10 +02:00
</ng-container>
2019-02-21 22:50:37 +01:00
<ng-container
2021-12-17 15:57:11 +01:00
*ngIf="
2019-02-21 22:50:37 +01:00
selectedProviderType === providerType.Duo ||
selectedProviderType === providerType.OrganizationDuo
2021-12-17 15:57:11 +01:00
"
>
2018-06-11 18:58:56 +02:00
<div id="duo-frame" class="mb-3">
2018-06-11 17:43:10 +02:00
<iframe id="duo_iframe"></iframe>
2021-12-17 15:57:11 +01:00
</div>
2018-06-11 17:43:10 +02:00
</ng-container>
2021-12-17 15:57:11 +01:00
<i
class="bwi bwi-spinner text-muted bwi-spin pull-right"
2019-10-11 16:35:24 +02:00
title="{{ 'loading' | i18n }}"
2021-03-16 17:44:31 +01:00
*ngIf="form.loading && selectedProviderType === providerType.WebAuthn"
2019-10-11 16:35:24 +02:00
aria-hidden="true"
2021-12-17 15:57:11 +01:00
></i>
2018-06-11 17:43:10 +02:00
<div class="form-check" *ngIf="selectedProviderType != null">
2021-12-17 15:57:11 +01:00
<input
2019-02-21 22:50:37 +01:00
id="remember"
type="checkbox"
name="Remember"
class="form-check-input"
[(ngModel)]="remember"
2021-12-17 15:57:11 +01:00
/>
2019-02-21 22:50:37 +01:00
<label for="remember" class="form-check-label">{{ "rememberMe" | i18n }}</label>
2021-12-17 15:57:11 +01:00
</div>
2018-06-11 17:43:10 +02:00
<ng-container *ngIf="selectedProviderType == null">
<p>{{ "noTwoStepProviders" | i18n }}</p>
<p>{{ "noTwoStepProviders2" | i18n }}</p>
</ng-container>
2021-12-17 15:57:11 +01:00
<hr />
<div [hidden]="!showCaptcha()">
<iframe id="hcaptcha_iframe" height="80"></iframe>
</div>
2018-06-11 17:43:10 +02:00
<div class="d-flex mb-3">
2021-12-17 15:57:11 +01:00
<button
2019-02-21 22:50:37 +01:00
type="submit"
class="btn btn-primary btn-block btn-submit"
2021-03-16 17:44:31 +01:00
[disabled]="form.loading"
2021-12-17 15:57:11 +01:00
*ngIf="
2019-02-21 22:50:37 +01:00
selectedProviderType != null &&
selectedProviderType !== providerType.Duo &&
selectedProviderType !== providerType.OrganizationDuo &&
2021-03-16 17:44:31 +01:00
selectedProviderType !== providerType.WebAuthn
2021-12-17 15:57:11 +01:00
"
>
<span>
<i class="bwi bwi-sign-in" aria-hidden="true"></i> {{ "continue" | i18n }}
2021-12-17 15:57:11 +01:00
</span>
<i
class="bwi bwi-spinner bwi-spin"
2019-10-11 16:35:24 +02:00
title="{{ 'loading' | i18n }}"
aria-hidden="true"
2021-12-17 15:57:11 +01:00
></i>
2018-06-11 17:43:10 +02:00
</button>
<a routerLink="/login" class="btn btn-outline-secondary btn-block ml-2 mt-0">
2018-06-11 17:43:10 +02:00
{{ "cancel" | i18n }}
2021-12-17 15:57:11 +01:00
</a>
</div>
2018-06-11 17:43:10 +02:00
<div class="text-center">
<a href="#" appStopClick (click)="anotherMethod()">{{
"useAnotherTwoStepMethod" | i18n
2021-12-17 15:57:11 +01:00
}}</a>
</div>
2018-06-05 21:02:53 +02:00
</div>
2021-12-17 15:57:11 +01:00
</div>
2018-06-11 17:43:10 +02:00
</div>
2021-12-17 15:57:11 +01:00
</div>
2018-06-05 21:02:53 +02:00
</form>
2018-06-11 17:43:10 +02:00
<ng-template #twoFactorOptions></ng-template>