Login marche !
This commit is contained in:
@@ -8,16 +8,16 @@
|
||||
|
||||
<h1>Knots</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card" [formGroup]="loginForm">
|
||||
|
||||
<h3>Connectez-vous à Knots !</h3>
|
||||
|
||||
<ion-item lines="none" class="input">
|
||||
<ion-input placeholder="Login..."></ion-input>
|
||||
<ion-input formControlName="name" placeholder="Login..."></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item lines="none" class="input">
|
||||
<ion-input type="password" placeholder="Password..."></ion-input>
|
||||
<ion-input formControlName="password" type="password" placeholder="Password..."></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-button expand="block" class="btn" (click)="submitForm()">
|
||||
|
||||
@@ -31,6 +31,9 @@ export class LoginFormComponent {
|
||||
});
|
||||
|
||||
async submitForm(): Promise<void> {
|
||||
console.log('submitForm appelé');
|
||||
console.log('form valid:', this.loginForm.valid);
|
||||
console.log('form values:', this.loginForm.value);
|
||||
if (this.loginForm.valid) {
|
||||
this.isLoading = true;
|
||||
|
||||
@@ -40,6 +43,7 @@ export class LoginFormComponent {
|
||||
this.loginForm.value.password!
|
||||
);
|
||||
} catch (err: any) {
|
||||
console.error('Erreur complète:', err);
|
||||
if (err.status === 401) {
|
||||
console.error('Identifiant ou mot de passe incorrect.');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user