<form [formGroup]="form" (ngSubmit)="loginTotp()">
    <mat-card>
        <mat-card-content>
            <h2>{{'security.2fa.totp' | i18n}}</h2>
            <mat-error *ngIf="loginInvalid">
                {{'security.2fa.totp.invalid' | i18n}}
            </mat-error>
            <mat-form-field>
                <input id="code" name="code" matInput placeholder="{{'security.2fa.totp.code' | i18n}}" formControlName="code"
                    required>
                <mat-error>
                    {{'security.2fa.totp.missing' | i18n}}
                </mat-error>
            </mat-form-field>
            <mat-slide-toggle id="keep" name="keep" formControlName="keep">
                {{'security.2fa.totp.keepSession' | i18n}}
            </mat-slide-toggle>
        </mat-card-content>
        <mat-card-actions>
            <button type="submit" mat-raised-button color="primary"
                [disabled]="form.invalid">{{'security.2fa.totp.login' | i18n}}</button>
        </mat-card-actions>
    </mat-card>
</form>