connexion avec le back (non testé)

This commit is contained in:
MiharyR 2022-01-13 14:46:01 +01:00
parent 22f6d316b4
commit 6b9a6d7c73
14 changed files with 215 additions and 130 deletions

View file

@ -43,16 +43,16 @@ export class PageLoginComponent
// Callback de "onSeConnecter"
onSeConnecterCallback(retour: any): void
{
console.log(retour);
if(retour.status !== "success")
{
console.log(retour);
this.errorMessage = retour.message;
this.hasError = true;
}
else {
this.profilService.setId(retour.data.id);
this.profilService.setIsAdmin(retour.data.is_admin)
if(!retour.data.is_admin) this.router.navigateByUrl('admin/userList');
if(retour.data.is_admin) this.router.navigateByUrl('admin/userList');
else this.router.navigateByUrl('user/userList');
}
}