login fix
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user