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