Update login-page.component.ts

This commit is contained in:
2023-06-24 13:17:50 +02:00
parent 263e093f43
commit 0fc9102747

View File

@@ -32,7 +32,6 @@ export class LoginPageComponent implements OnInit {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
window.onGoogleLibraryLoad = () => { window.onGoogleLibraryLoad = () => {
console.log('Library loaded');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
@@ -42,7 +41,6 @@ export class LoginPageComponent implements OnInit {
auto_select: true, auto_select: true,
cancel_on_tap_outside: true cancel_on_tap_outside: true
}); });
console.log('initialized');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
@@ -52,12 +50,9 @@ export class LoginPageComponent implements OnInit {
document.getElementById("google-button"), document.getElementById("google-button"),
{ theme: "outline", size: "large", width: "100%" } { theme: "outline", size: "large", width: "100%" }
); );
console.log('button rendered');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
//google.accounts.id.prompt(); google.accounts.id.prompt();
}; };
} }
@@ -66,7 +61,10 @@ export class LoginPageComponent implements OnInit {
async handleCredentialResponse(response: any) { async handleCredentialResponse(response: any) {
try { try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const responsePayload: any = jwt_decode(response.credential); const responsePayload: any = jwt_decode(response.credential);
console.log('Response', response);
/*
this.auth$.user = new User({ this.auth$.user = new User({
googleCredentials: response.credential, googleCredentials: response.credential,
userName: `${responsePayload.given_name} ${responsePayload.family_name}`, userName: `${responsePayload.given_name} ${responsePayload.family_name}`,
@@ -82,6 +80,7 @@ export class LoginPageComponent implements OnInit {
this.router$.navigate(['/app']); this.router$.navigate(['/app']);
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
*/
} catch (e: any) { } catch (e: any) {
console.error('handleCredentialResponse', e); console.error('handleCredentialResponse', e);
this.ngZone$.run(() => { this.ngZone$.run(() => {
@@ -107,6 +106,7 @@ export class LoginPageComponent implements OnInit {
} finally { } finally {
this.loading = false; this.loading = false;
} }
} }
} }