You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
813 B
TypeScript
32 lines
813 B
TypeScript
import { Component } from '@angular/core';
|
|
import { Store } from '@ngrx/store';
|
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
|
|
import { RTLState } from '../../../../store/rtl.state';
|
|
import { closeAlert } from '../../../../store/rtl.actions';
|
|
|
|
@Component({
|
|
selector: 'rtl-login-token',
|
|
templateUrl: './login-2fa-token.component.html',
|
|
styleUrls: ['./login-2fa-token.component.scss']
|
|
})
|
|
export class LoginTokenComponent {
|
|
|
|
public token = '';
|
|
|
|
constructor(public dialogRef: MatDialogRef<LoginTokenComponent>, private store: Store<RTLState>) { }
|
|
|
|
onClose() {
|
|
this.dialogRef.close(null);
|
|
}
|
|
|
|
onVerifyToken(): boolean | void {
|
|
if (!this.token) {
|
|
return true;
|
|
}
|
|
this.dialogRef.close();
|
|
this.store.dispatch(closeAlert({ payload: { twoFAToken: this.token } }));
|
|
}
|
|
|
|
}
|