diff --git a/src/app/auth/login/login.page.html b/src/app/auth/login/login.page.html
index 250b3c5..d8730f5 100644
--- a/src/app/auth/login/login.page.html
+++ b/src/app/auth/login/login.page.html
@@ -63,6 +63,7 @@
color="dark"
expand="block"
size="large"
+ [disabled]="!fg.valid"
>
LOGIN
diff --git a/src/app/auth/login/login.page.ts b/src/app/auth/login/login.page.ts
index d8c1bca..5863343 100644
--- a/src/app/auth/login/login.page.ts
+++ b/src/app/auth/login/login.page.ts
@@ -34,9 +34,9 @@ export class LoginPage implements OnInit {
});
}
- async showErrorMessage(error) {
+ async showErrorMessage(errorMessage) {
const errorToast = await this.toastController.create({
- message: error.error,
+ message: errorMessage || 'Something went wrong',
position: 'bottom',
duration: 3000,
icon: 'warning',
@@ -61,7 +61,7 @@ export class LoginPage implements OnInit {
.pipe(finalize(() => this.loaderService.hideLoader()))
.subscribe({
next: () => this.router.navigate(['/home']),
- error: (err) => this.showErrorMessage(err),
+ error: (err) => this.showErrorMessage(err?.error?.message),
});
}
}