Client does not set auth cookie
authorChristos Stathis <chstath@ebs.gr>
Tue, 24 Apr 2012 10:16:46 +0000 (13:16 +0300)
committerChristos Stathis <chstath@ebs.gr>
Tue, 24 Apr 2012 10:16:46 +0000 (13:16 +0300)
src/gr/grnet/pithos/web/client/Pithos.java

index 522e111..362128e 100644 (file)
@@ -526,31 +526,25 @@ public class Pithos implements EntryPoint, ResizeHandler {
         * Parse and store the user credentials to the appropriate fields.
         */
        private boolean parseUserCredentials() {
-        username = Window.Location.getParameter("user");
-        token = Window.Location.getParameter("token");
         Configuration conf = (Configuration) GWT.create(Configuration.class);
                Dictionary otherProperties = Dictionary.getDictionary("otherProperties");
-        if (username == null || username.length() == 0 || token == null || token.length() == 0) {
-            String cookie = otherProperties.get("authCookie");
-            String auth = Cookies.getCookie(cookie);
-            if (auth == null) {
-                authenticateUser();
-                return false;
-            }
-            if (auth.startsWith("\""))
-               auth = auth.substring(1);
-            if (auth.endsWith("\""))
-               auth = auth.substring(0, auth.length() - 1);
-                       String[] authSplit = auth.split("\\" + conf.cookieSeparator(), 2);
-                       if (authSplit.length != 2) {
-                           authenticateUser();
-                           return false;
-                       }
-                       username = authSplit[0];
-                       token = authSplit[1];
+        String cookie = otherProperties.get("authCookie");
+        String auth = Cookies.getCookie(cookie);
+        if (auth == null) {
+            authenticateUser();
+            return false;
         }
-        else
-               Cookies.setCookie(otherProperties.get("authCookie"), username + conf.cookieSeparator() + token, null, "", "/", false);
+        if (auth.startsWith("\""))
+               auth = auth.substring(1);
+        if (auth.endsWith("\""))
+               auth = auth.substring(0, auth.length() - 1);
+               String[] authSplit = auth.split("\\" + conf.cookieSeparator(), 2);
+               if (authSplit.length != 2) {
+                   authenticateUser();
+                   return false;
+               }
+               username = authSplit[0];
+               token = authSplit[1];
 
         String gotoUrl = Window.Location.getParameter("goto");
                if (gotoUrl != null && gotoUrl.length() > 0) {