Author: tyrell
Date: Wed Mar 26 22:48:53 2008
New Revision: 15170

Log:

Fixing MASHUP-732

Modified:
   trunk/mashup/java/modules/www/validate_login.jsp

Modified: trunk/mashup/java/modules/www/validate_login.jsp
==============================================================================
--- trunk/mashup/java/modules/www/validate_login.jsp    (original)
+++ trunk/mashup/java/modules/www/validate_login.jsp    Wed Mar 26 22:48:53 2008
@@ -95,9 +95,30 @@
                 JDBCRegistry jdbcRegistry = (JDBCRegistry) 
context.getAttribute(
                         RegistryConstants.REGISTRY);
 
-                UserRealm realm = (UserRealm) 
context.getAttribute(RegistryConstants.REGISTRY_REALM);
+                UserRealm realm =
+                        (UserRealm) 
context.getAttribute(RegistryConstants.REGISTRY_REALM);
 
-                MashupUtils.login(userNameStored, passwordStored, 
session.getId());
+                try {
+                    MashupUtils.login(userNameStored, passwordStored, 
session.getId());
+                    
+                } catch (MashupFault mashupFault) {
+                    //The credentials stored in the cookie is invalid. 
Deleting the cookie.                             
+                    for (int x = 0; x < cookies.length; x++) {
+                        curCookie = cookies[x];
+                        if 
(curCookie.getName().equalsIgnoreCase("rememberMe")) {
+                            curCookie.setMaxAge(0);
+                            response.addCookie(curCookie);
+                        } else if 
(curCookie.getName().equalsIgnoreCase("username")) {
+                            curCookie.setMaxAge(0);
+                            response.addCookie(curCookie);
+                        } else if 
(curCookie.getName().equalsIgnoreCase("password")) {
+                            curCookie.setMaxAge(0);
+                            response.addCookie(curCookie);
+                        }
+                    }
+                    //Re-directing to the sign in page
+                    response.sendRedirect("signin.jsp");
+                }
 
                 SecureRegistry secureRegistry =
                         RegistryUtils.createSecureRegistry(userNameStored, 
jdbcRegistry, realm);

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to