login fix

This commit is contained in:
Michał Zieliski
2024-07-03 17:42:23 +02:00
parent d4bc74c292
commit fae5533556
2 changed files with 3 additions and 18 deletions

View File

@@ -16,8 +16,6 @@ export class AuthService {
user?: User;
apiTokenExpirationTime?: Moment;
public isGoogleLibLoaded: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(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 &&

View File

@@ -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() {