From 2345e1385312ed3194f572ce30235783662b1ac2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 Dec 2020 15:23:03 +0100 Subject: [PATCH] Fix login error display --- client/src/app/+login/login.component.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/src/app/+login/login.component.ts b/client/src/app/+login/login.component.ts index 2567f21f1..af747b7fa 100644 --- a/client/src/app/+login/login.component.ts +++ b/client/src/app/+login/login.component.ts @@ -71,6 +71,12 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni ngOnInit () { const snapshot = this.route.snapshot + // Avoid undefined errors when accessing form error properties + this.buildForm({ + username: LOGIN_USERNAME_VALIDATOR, + password: LOGIN_PASSWORD_VALIDATOR + }) + this.serverConfig = snapshot.data.serverConfig if (snapshot.queryParams.externalAuthToken) { @@ -82,11 +88,6 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni this.externalAuthError = true return } - - this.buildForm({ - username: LOGIN_USERNAME_VALIDATOR, - password: LOGIN_PASSWORD_VALIDATOR - }) } ngAfterViewInit () {