login fix
This commit is contained in:
@@ -16,8 +16,6 @@ export class AuthService {
|
|||||||
user?: User;
|
user?: User;
|
||||||
apiTokenExpirationTime?: Moment;
|
apiTokenExpirationTime?: Moment;
|
||||||
|
|
||||||
public isGoogleLibLoaded: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
|
||||||
|
|
||||||
bc!: BroadcastChannel;
|
bc!: BroadcastChannel;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -25,14 +23,6 @@ export class AuthService {
|
|||||||
) {
|
) {
|
||||||
this.createBroadcastChannel();
|
this.createBroadcastChannel();
|
||||||
this.askForAuthData();
|
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() {
|
ping() {
|
||||||
@@ -81,7 +71,6 @@ export class AuthService {
|
|||||||
return from(this.getAPIToken());
|
return from(this.getAPIToken());
|
||||||
}
|
}
|
||||||
isAuthenticated(): boolean {
|
isAuthenticated(): boolean {
|
||||||
console.log('IsAuthenticated');
|
|
||||||
return !!this.apiToken &&
|
return !!this.apiToken &&
|
||||||
!!this.webCredentials &&
|
!!this.webCredentials &&
|
||||||
!!this.user &&
|
!!this.user &&
|
||||||
|
|||||||
@@ -26,13 +26,9 @@ export class LoginViewComponent implements OnInit {
|
|||||||
loading = false;
|
loading = false;
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
console.log('Init loginViewComponent');
|
setTimeout(() => {
|
||||||
this.auth$.isGoogleLibLoaded.subscribe((isLoaded) => {
|
this.initGoogleLogin();
|
||||||
console.log('GoogleLibLoaded', isLoaded);
|
}, 500);
|
||||||
if (isLoaded) {
|
|
||||||
this.initGoogleLogin();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initGoogleLogin() {
|
initGoogleLogin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user