diff --git a/covas_mobile/lib/main.dart b/covas_mobile/lib/main.dart index 46cf42b..d5f8833 100644 --- a/covas_mobile/lib/main.dart +++ b/covas_mobile/lib/main.dart @@ -45,7 +45,45 @@ class _LoginDemoState extends State { MaterialPageRoute( builder: (_) => MyHomePage(title: 'Flutter Demo'))); } else { - showErrorDialog(context, "Probleme d'authentification"); + var text = ""; + switch (response.statusCode) { + case 400: + { + text = "RequĂȘte mal construite"; + } + break; + case 406: + { + text = "Mot de passe incorrect"; + } + break; + case 404: + { + text = "Utilisateur inconnu"; + } + break; + case 403: + { + text = "Utilisateur desactive"; + } + break; + case 410: + { + text = "Token invalide"; + } + break; + case 500: + { + text = "Probleme interne du serveur"; + } + break; + default: + { + text = "Probleme d'authentification inconnu"; + } + break; + } + showErrorDialog(context, text); } } else { showErrorDialog(context, "Champ vide");