Bug 471076: explicitly check login succeeded
authorDan Mills <thunder@mozilla.com>
Fri, 26 Dec 2008 16:08:55 -0800
changeset 45137 5fa321063d616a7004ef577999021accea86cec8
parent 45136 4d418b1e95bfd496152d63d763472b35f5daa3d8
child 45138 d4169b45da1fb4956293c75ec8a00c1a0c8af371
push idunknown
push userunknown
push dateunknown
bugs471076
Bug 471076: explicitly check login succeeded
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -414,16 +414,18 @@ WeaveSvc.prototype = {
 
   // These are global (for all engines)
 
   _verifyLogin: function WeaveSvc__verifyLogin(username, password) {
     let self = yield;
     this._log.debug("Verifying login for user " + username);
     let res = new Resource(this.baseURL + username);
     yield res.get(self.cb);
+    if (res.data != "1")
+      throw "Login failed";
   },
   verifyLogin: function WeaveSvc_verifyLogin(onComplete, username, password) {
     this._localLock(this._notify("verify-login", "", this._verifyLogin,
                                  username, password)).async(this, onComplete);
   },
 
   _verifyPassphrase: function WeaveSvc__verifyPassphrase(username, password,
                                                          passphrase) {