UI: Fix login url params

This commit is contained in:
Igor Kulikov 2020-04-09 18:39:58 +03:00
parent cc123a9e67
commit 5e3c85a897

View File

@ -23,7 +23,7 @@ import { FormBuilder } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { Constants } from '@shared/models/constants'; import { Constants } from '@shared/models/constants';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ActivatedRoute } from "@angular/router"; import { ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: 'tb-login', selector: 'tb-login',
@ -46,8 +46,9 @@ export class LoginComponent extends PageComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
if (this.route.snapshot.queryParams["username"] && this.route.snapshot.queryParams["password"]) { if (this.route.snapshot.queryParams.username && this.route.snapshot.queryParams.password) {
this.loginFormGroup.setValue({username: this.route.snapshot.queryParams["username"], password: this.route.snapshot.queryParams["password"]}); this.loginFormGroup.setValue({username: this.route.snapshot.queryParams.username,
password: this.route.snapshot.queryParams.password});
this.login(); this.login();
} }
} }