mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-05-16 01:21:47 +00:00
refactor(DevWeb): Edit Bean file to handle errors
This commit is contained in:
@@ -46,10 +46,8 @@ public class LoginServlet extends HttpServlet {
|
||||
|
||||
httpResponse = new HttpResponse(HttpResponseCode.OK, "Login success");
|
||||
} else {
|
||||
httpResponse = new HttpResponse(HttpResponseCode.UNAUTHORIZED, "<strong>Erreur de connexion:</strong> Le nom d'utilisateur ou le " +
|
||||
"mot de passe est incorrect.");
|
||||
httpResponse = loginBean.getError();
|
||||
}
|
||||
|
||||
out.println(gson.toJson(httpResponse));
|
||||
out.flush();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class RegisterServlet extends HttpServlet {
|
||||
"Register success"
|
||||
);
|
||||
} else {
|
||||
httpResponse = new HttpResponse(HttpResponseCode.UNAUTHORIZED, registerBean.getErrorMessage());
|
||||
httpResponse = registerBean.getError();
|
||||
}
|
||||
|
||||
out.println(gson.toJson(httpResponse));
|
||||
|
||||
Reference in New Issue
Block a user