OSDN Git Service

ログイン時に正しくログインできているかどうかの確認を追加
authoryukihane <yukihane.feather@gmail.com>
Sun, 18 Sep 2011 03:27:11 +0000 (12:27 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sun, 18 Sep 2011 03:30:23 +0000 (12:30 +0900)
frontend/src/saccubus/worker/impl/download/Download.java

index 898b7db..a41d2b2 100644 (file)
@@ -154,12 +154,17 @@ public class Download extends Worker<DownloadResult, DownloadProgress> {
             final boolean hasLogin = client.login(profile.getLoginProfile().getMail(), profile.getLoginProfile().
                     getPassword());
             if (!hasLogin) {
-                throw new IOException("login fail");
+                throw new IOException("login failed");
             }
         } else {
             client.addCookie(profile.getLoginProfile().getCookies());
         }
 
+        boolean hasLogin = client.challengeAuth();
+        if (!hasLogin) {
+            throw new IOException("invalid session(wrong id/pass or cookie parameter)");
+        }
+
         return client;
     }