1
0
mirror of https://github.com/dkmstr/openuds-gui.git synced 2024-12-22 17:33:48 +03:00

Added MFA input page

This commit is contained in:
Adolfo Gómez García 2022-06-23 15:16:44 +02:00
parent 4e0796c5e9
commit cf713a333e
4 changed files with 5 additions and 5 deletions

View File

@ -17,6 +17,6 @@
{{ error }} {{ error }}
</p> </p>
<a mat-raised-button color="warn" routerLink="/"><uds-translate>Return</uds-translate></a> <a mat-raised-button color="warn" [routerLink]="returnUrl"><uds-translate>Return</uds-translate></a>
</div> </div>

View File

@ -12,6 +12,7 @@ declare const udsData: any;
}) })
export class ErrorComponent implements OnInit { export class ErrorComponent implements OnInit {
error: string; error: string;
returnUrl: string;
constructor(public api: UDSApiService, private route: ActivatedRoute) {} constructor(public api: UDSApiService, private route: ActivatedRoute) {}
@ -21,6 +22,9 @@ export class ErrorComponent implements OnInit {
getError(): void { getError(): void {
const id = this.route.snapshot.paramMap.get('id'); const id = this.route.snapshot.paramMap.get('id');
if (id === '19') {
this.returnUrl = '/mfa';
}
this.error = ''; this.error = '';
// Request error string from UDS // Request error string from UDS
this.api.getErrorInformation(id).subscribe((errInfo) => { this.api.getErrorInformation(id).subscribe((errInfo) => {

View File

@ -1,5 +1,4 @@
<form id="mfaform" method="post" (ngSubmit)="launch()"> <form id="mfaform" method="post" (ngSubmit)="launch()">
<input name="" id="token" value="" type="hidden" />
<div class="mfa-container"> <div class="mfa-container">
<div class="mfa-brand"> <div class="mfa-brand">
<img [src]="api.staticURL('modern/img/login-img.png')" /> <img [src]="api.staticURL('modern/img/login-img.png')" />

View File

@ -16,9 +16,6 @@ export class MfaComponent implements OnInit {
// adapt form to post the correct values the correct way // adapt form to post the correct values the correct way
const form = document.getElementById('mfaform') as HTMLFormElement; const form = document.getElementById('mfaform') as HTMLFormElement;
form.action = this.api.config.urls.mfa; form.action = this.api.config.urls.mfa;
const input = document.getElementById('token') as HTMLInputElement;
input.name = this.api.csrfField;
input.value = this.api.csrfToken;
if (this.api.errors.length > 0) { if (this.api.errors.length > 0) {
this.api.gui.alert( this.api.gui.alert(