From 136c9a2f6dfe1eade1ac3e911738ac07cd8d40ca Mon Sep 17 00:00:00 2001 From: Supichai Pothong Date: Thu, 26 Oct 2023 14:30:34 +0700 Subject: [PATCH] [update] --- src/app/auth/login/login.component.ts | 8 +++----- src/app/core/core.module.ts | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/auth/login/login.component.ts b/src/app/auth/login/login.component.ts index 765b9e5..4ad0390 100644 --- a/src/app/auth/login/login.component.ts +++ b/src/app/auth/login/login.component.ts @@ -43,11 +43,9 @@ export class LoginComponent implements OnInit { async onSubmit(form: any) { if (!form.valid) return false; try { - // const result = await lastValueFrom(this.authService.login(this.dataForm)); - const cathayResult = await lastValueFrom(this.cathayAuthService.login(this.cathayForm)) - // this.cathayAuthService.login(this.cathayForm).subscribe(res => console.log(res)) - console.log(cathayResult) - this.appService.setAuth(cathayResult); + const result = await lastValueFrom(this.authService.login(this.dataForm)); + // const cathayResult = await lastValueFrom(this.cathayAuthService.login(this.cathayForm)) + this.appService.setAuth(result); return this.router.navigate(['/pages']); } catch (err) { return this.appService.message(EAction.ERROR, EText.NO_DATA); diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 51c98e0..65331a7 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -14,7 +14,7 @@ import { TokenIntercepterInterceptor } from './intercepter/token-intercepter.int HttpClientModule, ], providers: [ - { provide: HTTP_INTERCEPTORS, useClass: TokenIntercepterInterceptor, multi: true }, + // { provide: HTTP_INTERCEPTORS, useClass: TokenIntercepterInterceptor, multi: true }, ] }) export class CoreModule { }