From 469c83856dd8fd366871def59008e9f4a8c605f4 Mon Sep 17 00:00:00 2001 From: Patrick Mueller Date: Sat, 5 Aug 2023 18:10:29 +0200 Subject: [PATCH] #15: Improve error handling during login --- src/app/pages/admin/admin.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/pages/admin/admin.component.ts b/src/app/pages/admin/admin.component.ts index 737a12f..383c278 100644 --- a/src/app/pages/admin/admin.component.ts +++ b/src/app/pages/admin/admin.component.ts @@ -149,9 +149,13 @@ export class AdminComponent implements OnInit { this.name = user.fullName; this.isActive = user.isActive; this.getEvents(); + } else { + confirm('Login unsuccessful. Please check if you provided the correct username and password.'); } }); } + }, (error) => { + confirm('Login unsuccessful. Reported problem from server: ' + error.error.message); }); } @@ -161,7 +165,7 @@ export class AdminComponent implements OnInit { UtilsService.saveSessionInfoToLocalStorage(session.sessionId, session.sessionKey); this.isLoggedIn = true; this.getEvents(); - confirm('Please talk to Patrick to activate your account. You can\'t use this application before that.') + confirm('Please talk to Patrick to activate your account. You can\'t use this application before that.'); } }); }