page d'accueil fixed
This commit is contained in:
parent
acfb169715
commit
2f5705e766
4 changed files with 28 additions and 23 deletions
|
|
@ -13,10 +13,10 @@
|
|||
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button>
|
||||
|
||||
</form>
|
||||
|
||||
<!--
|
||||
<div *ngIf="errorForm">
|
||||
<p class="text-danger">Il manque des informations dans le formulaire...</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</main>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,25 +14,20 @@ import {
|
|||
styleUrls: ['./page-forgot-password.component.scss']
|
||||
})
|
||||
export class PageForgotPasswordComponent implements OnInit {
|
||||
public errorForm: boolean;
|
||||
constructor(private authService: AuthService, private router: Router) {
|
||||
this.errorForm = false;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
public onSubmit(submittedForm: any): void {
|
||||
|
||||
public onSubmit(submittedForm: any): void {
|
||||
console.log(submittedForm.form.value);
|
||||
|
||||
const email = submittedForm.form.value['email'];
|
||||
if (email !== '') {
|
||||
this.authService.forgotPassword(email).subscribe((resp) => {
|
||||
console.log('Component : PageForgotPassword ', resp);
|
||||
this.router.navigate(['reinitialisation-password']);
|
||||
});
|
||||
} else {
|
||||
// afficher une erreur à l'utilisateur
|
||||
this.errorForm = true;
|
||||
}
|
||||
console.log(email);
|
||||
window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
||||
this.router.navigate(['reinitialisation-password']);
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue