Improve login error message
This commit is contained in:
committed by
Aditya Chandel
parent
04e517f406
commit
3c1288edc8
@@ -42,8 +42,12 @@ export class LoginComponent {
|
|||||||
this.router.navigate(['/dashboard']);
|
this.router.navigate(['/dashboard']);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: (error) => {
|
||||||
this.errorMessage = 'Invalid username or password';
|
if (error.status === 0) {
|
||||||
|
this.errorMessage = 'Cannot connect to the server. Please check your connection and try again.';
|
||||||
|
} else {
|
||||||
|
this.errorMessage = error?.error?.message || 'An unexpected error occurred. Please try again.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user