details:   https://code.openbravo.com/erp/devel/pi/rev/925d93d4e897
changeset: 35246:925d93d4e897
user:      Javier Armendáriz <javier.armendariz <at> openbravo.com>
date:      Fri Dec 14 12:21:18 2018 +0100
summary:   Fixed issue 39776: Exception appears after login with user with no 
roles

Now current session is cleared if a error is found in login process. This
prevents the user to be stuck in a exception screen with no chance to log in
again.

diffstat:

 src/org/openbravo/base/secureApp/LoginHandler.java |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 16c92a53d9b9 -r 925d93d4e897 
src/org/openbravo/base/secureApp/LoginHandler.java
--- a/src/org/openbravo/base/secureApp/LoginHandler.java        Fri Dec 14 
15:02:42 2018 +0000
+++ b/src/org/openbravo/base/secureApp/LoginHandler.java        Fri Dec 14 
12:21:18 2018 +0100
@@ -514,13 +514,18 @@
 
     // Show the message in the login window, return a JSON object with the 
info to print the message
     try {
+      boolean loginHasError = "Error".equals(msgType);
       JSONObject jsonMsg = new JSONObject();
       jsonMsg.put("showMessage", true);
-      jsonMsg.put("target", "Error".equals(msgType) ? null : action);
+      jsonMsg.put("target", loginHasError ? null : action);
       jsonMsg.put("messageType", msgType);
       jsonMsg.put("messageTitle", title);
       jsonMsg.put("messageText", msg);
 
+      if(loginHasError) {
+        vars.clearSession(false);
+      }
+
       response.setContentType("application/json;charset=UTF-8");
       final PrintWriter out = response.getWriter();
       out.print(jsonMsg.toString());


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to