ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1347607 - /ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java
Date Thu, 07 Jun 2012 13:31:48 GMT
Author: jawi
Date: Thu Jun  7 13:31:47 2012
New Revision: 1347607

URL: http://svn.apache.org/viewvc?rev=1347607&view=rev
Log:
When a login fails due to exceptions, destroy the session. Otherwise, users can no longer
login after this.

Modified:
    ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java

Modified: ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java
URL: http://svn.apache.org/viewvc/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java?rev=1347607&r1=1347606&r2=1347607&view=diff
==============================================================================
--- ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java
(original)
+++ ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinClient.java
Thu Jun  7 13:31:47 2012
@@ -966,10 +966,23 @@ public class VaadinClient extends com.va
             m_admin.login(context);
             initGrid(user);
             m_admin.checkout();
+
             return true;
         }
         catch (Exception e) {
-            m_log.log(LogService.LOG_WARNING, "Login failed!", e);
+            m_log.log(LogService.LOG_WARNING, "Login failed! Destroying session...", e);
+            
+            try {
+                // Avoid errors when the user tries to login again (due to the stale session)...
+                m_admin.logout(true /* force */);
+            }
+            catch (IllegalStateException inner) {
+                // Ignore; probably we're not logged...
+            }
+            catch (IOException inner) {
+                m_log.log(LogService.LOG_WARNING, "Logout failed! Session possibly not destroyed...",
inner);
+            }
+
             return false;
         }
     }



Mime
View raw message