fix 2FA
This commit is contained in:
parent
5304409ea4
commit
9ab0b9553c
@ -1,4 +1,4 @@
|
|||||||
<form action="{{apiUrl}}/auth/formlogin/totp" method="POST" #totpForm>
|
<form action="{{apiUrl}}/auth/login/totp" method="POST" #totpForm>
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<h2>{{'security.2fa.totp.external' | i18n}}<mat-icon style="font-size: 1em;">open_in_new
|
<h2>{{'security.2fa.totp.external' | i18n}}<mat-icon style="font-size: 1em;">open_in_new
|
||||||
@ -13,6 +13,9 @@
|
|||||||
{{'security.2fa.totp.missing' | i18n}}
|
{{'security.2fa.totp.missing' | i18n}}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-slide-toggle id="keep" name="keep" [checked]="keep" >
|
||||||
|
{{'login.keepSession' | i18n}}
|
||||||
|
</mat-slide-toggle>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<mat-card-actions>
|
<mat-card-actions>
|
||||||
<button type="submit" mat-raised-button color="primary" (click)="totpForm.submit()"
|
<button type="submit" mat-raised-button color="primary" (click)="totpForm.submit()"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
|
||||||
|
|
||||||
import {environment} from '../../../environments/environment';
|
import {environment} from '../../../environments/environment';
|
||||||
|
|
||||||
@ -12,15 +11,22 @@ import {environment} from '../../../environments/environment';
|
|||||||
export class FormLoginTotpComponent implements OnInit {
|
export class FormLoginTotpComponent implements OnInit {
|
||||||
|
|
||||||
loginInvalid: boolean;
|
loginInvalid: boolean;
|
||||||
|
keep: boolean = false;
|
||||||
apiUrl = environment.apiUrl;
|
apiUrl = environment.apiUrl;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private router: Router,
|
||||||
private route: ActivatedRoute) {}
|
private route: ActivatedRoute) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if(params['error'] || params['error'] == '') {
|
if(params['error'] || params['error'] == '') {
|
||||||
this.loginInvalid = true;
|
this.loginInvalid = true;
|
||||||
|
this.router.navigate([], {queryParams: {error: null}, queryParamsHandling: 'merge'});
|
||||||
|
}
|
||||||
|
if(params['keep'] || params['keep'] == '') {
|
||||||
|
this.keep = true;
|
||||||
|
this.router.navigate([], {queryParams: {keep: null}, queryParamsHandling: 'merge'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ export class FormLoginComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
if(params['error'] || params['error'] == '') {
|
if(params['error'] || params['error'] == '') {
|
||||||
this.loginInvalid = true;
|
this.loginInvalid = true;
|
||||||
|
this.router.navigate([], {queryParams: {error: null}, queryParamsHandling: 'merge'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user