upgrade dependencies and migrate
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Auth2FAService } from '../../services/auth.2fa.service';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
standalone: false,
|
||||
selector: 'app-login-totp',
|
||||
templateUrl: './login-totp.component.html',
|
||||
styleUrls: [ './login-totp.component.scss' ]
|
||||
styleUrls: ['./login-totp.component.scss']
|
||||
})
|
||||
export class LoginTotpComponent implements OnInit {
|
||||
|
||||
@@ -22,14 +23,14 @@ export class LoginTotpComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.form = this.formBuilder.group({
|
||||
code: [ '', Validators.required ],
|
||||
keep: [ '' ]
|
||||
code: ['', Validators.required],
|
||||
keep: ['']
|
||||
});
|
||||
|
||||
this.route.queryParams.subscribe({
|
||||
next: (params) => {
|
||||
if (params[ 'target' ]) {
|
||||
this.targetRoute = params[ 'target' ];
|
||||
if (params['target']) {
|
||||
this.targetRoute = params['target'];
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -40,7 +41,7 @@ export class LoginTotpComponent implements OnInit {
|
||||
if (this.form.valid) {
|
||||
this.auth2FAService.login('totp', this.form.get('code').value, this.form.get('keep').value).subscribe({
|
||||
next: (response: any) => {
|
||||
this.router.navigate([ this.targetRoute ]);
|
||||
this.router.navigate([this.targetRoute]);
|
||||
},
|
||||
error: (error) => {
|
||||
this.loginInvalid = true;
|
||||
|
||||
Reference in New Issue
Block a user