Remove specs + eslind on front
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, NgZone, OnInit } from '@angular/core';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Router } from '@angular/router';
|
||||
import jwt_decode from "jwt-decode";
|
||||
import { AuthService } from 'src/app/auth/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
@@ -22,12 +20,14 @@ export class LoginPageComponent implements OnInit {
|
||||
private snackBar$: MatSnackBar
|
||||
) { }
|
||||
|
||||
loading: boolean = false;
|
||||
loading = false;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.snackBar$.open("", "", { duration: 1 });
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
window.onGoogleLibraryLoad = () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
google.accounts.id.initialize({
|
||||
client_id: environment.google.clientId,
|
||||
@@ -35,19 +35,24 @@ export class LoginPageComponent implements OnInit {
|
||||
auto_select: true,
|
||||
cancel_on_tap_outside: true
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
google.accounts.id.renderButton(
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
document.getElementById("google-button"),
|
||||
{ theme: "outline", size: "large", width: "100%" }
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
google.accounts.id.prompt((notification: PromptMomentNotification) => { });
|
||||
google.accounts.id.prompt();
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async handleCredentialResponse(response: any) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const responsePayload: any = jwt_decode(response.credential);
|
||||
this.auth$.user = new User({
|
||||
googleCredentials: response.credential,
|
||||
@@ -60,6 +65,7 @@ export class LoginPageComponent implements OnInit {
|
||||
this.ngZone$.run(() => {
|
||||
this.router$.navigate(['/app']);
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} catch (e: any) {
|
||||
this.loading = false;
|
||||
if (e.status === 401) {
|
||||
|
||||
Reference in New Issue
Block a user