From bd3f7dd80ba7244d62014c44bb8971422e57f1a2 Mon Sep 17 00:00:00 2001 From: Jannic Veith Date: Thu, 11 Jul 2024 15:19:00 +0200 Subject: [PATCH] Only resolve login process on success --- .../components/splash-screen/splash-screen.component.html | 2 +- libs/auth/src/lib/services/auth.service.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/client-asset-sg/src/app/components/splash-screen/splash-screen.component.html b/apps/client-asset-sg/src/app/components/splash-screen/splash-screen.component.html index 10033ce1..f09bc11b 100644 --- a/apps/client-asset-sg/src/app/components/splash-screen/splash-screen.component.html +++ b/apps/client-asset-sg/src/app/components/splash-screen/splash-screen.component.html @@ -8,7 +8,7 @@ />

{{ "welcomeTo" | translate }} {{ host }}

-

Asset Data Management System

+

Assets

diff --git a/libs/auth/src/lib/services/auth.service.ts b/libs/auth/src/lib/services/auth.service.ts index 9ed8a4a7..07aeeece 100644 --- a/libs/auth/src/lib/services/auth.service.ts +++ b/libs/auth/src/lib/services/auth.service.ts @@ -39,9 +39,11 @@ export class AuthService { async signIn(): Promise { try { if (this.state.value === AuthState.Ongoing) { - await this.oauthService.loadDiscoveryDocumentAndLogin(); - this.oauthService.setupAutomaticSilentRefresh(); - this.state.next(AuthState.Success); + const success = await this.oauthService.loadDiscoveryDocumentAndLogin(); + if (success) { + this.oauthService.setupAutomaticSilentRefresh(); + this.state.next(AuthState.Success); + } } else { this.state.next(AuthState.Ongoing); this.oauthService.initLoginFlow();