2 <my-global-icon iconName=
"cog" aria-hidden=
"true"></my-global-icon>
3 <ng-container i18n
>Two factor authentication
</ng-container>
6 <div i18n *
ngIf=
"twoFactorAlreadyEnabled === true" class=
"root already-enabled">
7 Two factor authentication is already enabled.
10 <div class=
"root" *
ngIf=
"twoFactorAlreadyEnabled === false">
11 <ng-container *
ngIf=
"step === 'request'">
12 <form role=
"form" (ngSubmit)=
"requestTwoFactor()" [formGroup]=
"formPassword">
14 <label i18n
for=
"current-password">Your password
</label>
15 <div class=
"form-group-description" i18n
>Confirm your password to enable two factor authentication
</div>
18 formControlName=
"current-password" inputId=
"current-password" i18n-placeholder
placeholder=
"Current password"
19 [formError]=
"formErrorsPassword['current-password']" autocomplete=
"current-password"
22 <input class=
"peertube-button orange-button mt-3" type=
"submit" i18n-value
value=
"Confirm" [disabled]=
"!formPassword.valid">
26 <ng-container *
ngIf=
"step === 'confirm'">
29 Scan this QR code into a TOTP app on your phone. This app will generate tokens that you will have to enter when logging in.
32 <qrcode [qrdata]=
"twoFactorURI" [width]=
"256" level=
"Q"></qrcode>
35 If you can't scan the QR code and need to enter it manually, here is the plain-text secret:
38 <div class=
"secret-plain-text">{{ twoFactorSecret }}
</div>
40 <form class=
"mt-3" role=
"form" (ngSubmit)=
"confirmTwoFactor()" [formGroup]=
"formOTP">
42 <label i18n
for=
"otp-token">Two-factor code
</label>
43 <div class=
"form-group-description" i18n
>Enter the code generated by your authenticator app to confirm
</div>
46 [show]=
"true" formControlName=
"otp-token" inputId=
"otp-token"
47 [formError]=
"formErrorsOTP['otp-token']" autocomplete=
"otp-token"
50 <input class=
"peertube-button orange-button mt-3" type=
"submit" i18n-value
value=
"Confirm" [disabled]=
"!formOTP.valid">