Bug 1001182 - FxAccountsManager.jsm correctly handles {refreshAuthentication:0} r=jedp
authorSam Penrose <spenrose@mozilla.com>
Mon, 28 Apr 2014 09:44:36 -0700
changeset 181177 5e58a8f23067b403f4a625561d9b9fa13082059b
parent 181176 3608f5b12dc896d45484abc493525eda5b030289
child 181178 ba3c6ac9dfdab0eae6d84a8cfc8e7a56c0927609
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjedp
bugs1001182
milestone32.0a1
Bug 1001182 - FxAccountsManager.jsm correctly handles {refreshAuthentication:0} r=jedp
services/fxaccounts/FxAccountsManager.jsm
--- a/services/fxaccounts/FxAccountsManager.jsm
+++ b/services/fxaccounts/FxAccountsManager.jsm
@@ -373,17 +373,17 @@ this.FxAccountsManager = {
           if (!user.verified) {
             return this._error(ERROR_UNVERIFIED_ACCOUNT, {
               user: user
             });
           }
 
           // RPs might require an authentication refresh.
           if (aOptions &&
-              aOptions.refreshAuthentication) {
+              (typeof(aOptions.refreshAuthentication) != "undefined")) {
             let gracePeriod = aOptions.refreshAuthentication;
             if (typeof gracePeriod != 'number' || isNaN(gracePeriod)) {
               return this._error(ERROR_INVALID_REFRESH_AUTH_VALUE);
             }
 
             if ((Date.now() / 1000) - this._activeSession.authAt > gracePeriod) {
               // Grace period expired, so we sign out and request the user to
               // authenticate herself again. If the authentication succeeds, we