From fae5533556d1f0f80865d3d8771483ee10c8602c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieliski?= Date: Wed, 3 Jul 2024 17:42:23 +0200 Subject: [PATCH] login fix --- Frontend/src/app/auth/auth.service.ts | 11 ----------- Frontend/src/app/views/login/login-view.component.ts | 10 +++------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/Frontend/src/app/auth/auth.service.ts b/Frontend/src/app/auth/auth.service.ts index 47d4302..03cab7c 100644 --- a/Frontend/src/app/auth/auth.service.ts +++ b/Frontend/src/app/auth/auth.service.ts @@ -16,8 +16,6 @@ export class AuthService { user?: User; apiTokenExpirationTime?: Moment; - public isGoogleLibLoaded: BehaviorSubject = new BehaviorSubject(false); - bc!: BroadcastChannel; constructor( @@ -25,14 +23,6 @@ export class AuthService { ) { this.createBroadcastChannel(); this.askForAuthData(); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - console.log('Check if loaded', window.onGoogleLibraryLoad); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - window.onGoogleLibraryLoad = () => { - this.isGoogleLibLoaded.next(true); - }; } ping() { @@ -81,7 +71,6 @@ export class AuthService { return from(this.getAPIToken()); } isAuthenticated(): boolean { - console.log('IsAuthenticated'); return !!this.apiToken && !!this.webCredentials && !!this.user && diff --git a/Frontend/src/app/views/login/login-view.component.ts b/Frontend/src/app/views/login/login-view.component.ts index c56f269..38c4606 100644 --- a/Frontend/src/app/views/login/login-view.component.ts +++ b/Frontend/src/app/views/login/login-view.component.ts @@ -26,13 +26,9 @@ export class LoginViewComponent implements OnInit { loading = false; ngOnInit(): void { - console.log('Init loginViewComponent'); - this.auth$.isGoogleLibLoaded.subscribe((isLoaded) => { - console.log('GoogleLibLoaded', isLoaded); - if (isLoaded) { - this.initGoogleLogin(); - } - }); + setTimeout(() => { + this.initGoogleLogin(); + }, 500); } initGoogleLogin() {