Update login-page.component.ts
This commit is contained in:
@@ -60,31 +60,25 @@ export class LoginPageComponent implements OnInit {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async handleCredentialResponse(response: any) {
|
||||
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);
|
||||
console.log('Response', response);
|
||||
|
||||
this.auth$.user = new User({
|
||||
googleCredentials: response.credential,
|
||||
userName: `${responsePayload.given_name} ${responsePayload.family_name}`,
|
||||
email: responsePayload.email,
|
||||
avatar: responsePayload.picture
|
||||
});
|
||||
this.ngZone$.run(() => {
|
||||
this.loading = true;
|
||||
});
|
||||
console.log('AuthUser', this.auth$.user);
|
||||
|
||||
//this.ngZone$.run(() => {
|
||||
// this.loading = true;
|
||||
//});
|
||||
this.auth$.googleCredential = response.credential;
|
||||
console.log(response.credential);
|
||||
await this.auth$.getAPIToken();
|
||||
console.log('after api token');
|
||||
//this.ngZone$.run(() => {
|
||||
// this.router$.navigate(['/app']);
|
||||
//});
|
||||
this.ngZone$.run(() => {
|
||||
this.router$.navigate(['/app']);
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
} catch (e: any) {
|
||||
console.error('handleCredentialResponse', e);
|
||||
this.ngZone$.run(() => {
|
||||
|
||||
Reference in New Issue
Block a user