Backend authentication

This commit is contained in:
2022-12-09 00:14:05 +01:00
parent 81b5f323eb
commit a2c90f80d5
8 changed files with 83 additions and 60 deletions

View File

@@ -43,7 +43,6 @@ export class LoginPageComponent implements OnInit {
async handleCredentialResponse(response: any) {
try {
console.log("Google Response", response);
const responsePayload: any = jwt_decode(response.credential);
this.data$.currentUser = new User({
googleCredentials: response.credential,
@@ -51,10 +50,8 @@ export class LoginPageComponent implements OnInit {
email: responsePayload.email,
avatar: responsePayload.picture
});
// this.auth$.loadDbUser();
console.log("USer", this.data$.currentUser);
await this.auth$.getAPIToken(response.credential);
// this.auth$.loadDbUser();
this.auth$.ping();
this.ngZone$.run(() => {
this.router$.navigate(['/app']);
});