server returns a json object for user root now, modify checkLogin() accordingly
authorDan Mills <thunder@mozilla.com>
Mon, 02 Feb 2009 11:44:07 -0800
changeset 45217 e007a53e57286ec71f9d4a13000b24a5d32d0d16
parent 45216 e4d4608fd6b6ce34a1d83302a48f3e074792c76b
child 45218 b0f1590a1d53d44c5df3c3afac850380923d1128
push idunknown
push userunknown
push dateunknown
server returns a json object for user root now, modify checkLogin() accordingly
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -416,18 +416,17 @@ WeaveSvc.prototype = {
   verifyLogin: function WeaveSvc_verifyLogin(onComplete, username, password) {
     let user = username, pass = password;
 
     let fn = function WeaveSvc__verifyLogin() {
       let self = yield;
       this._log.debug("Verifying login for user " + user);
       let res = new Resource(this.baseURL + user);
       yield res.get(self.cb);
-      if (res.data != "\"1\"")
-        throw "Login failed";
+      Svc.Json.decode(res.data); // will throw if not json
       self.done(true);
     };
     this._notify("verify-login", "", fn).async(this, onComplete);
   },
 
   _verifyPassphrase: function WeaveSvc__verifyPassphrase(username, password,
                                                          passphrase) {
     let self = yield;