diff --git a/resources/static/dialog/controllers/check_registration.js b/resources/static/dialog/controllers/check_registration.js index 04a9711b693e18364f5bef6691735ecc29b42129..05ed707771575c346337b447980bb4b441c2a25b 100644 --- a/resources/static/dialog/controllers/check_registration.js +++ b/resources/static/dialog/controllers/check_registration.js @@ -38,7 +38,7 @@ BrowserID.Modules.CheckRegistration = (function() { }); } else if (status === "mustAuth") { - self.close("auth", { email: self.email }); + self.close("authenticate", { email: self.email }); oncomplete && oncomplete(); } }, self.getErrorDialog(errors.registration, oncomplete)); diff --git a/resources/static/shared/user.js b/resources/static/shared/user.js index e25e27d8ad5e104211733d09144ee0ac02979809..d1994d33564702574b8f6ad73441310fc5d23e2a 100644 --- a/resources/static/shared/user.js +++ b/resources/static/shared/user.js @@ -112,6 +112,19 @@ BrowserID.User = (function() { // ensure that the stagedOnBehalfOf is cleared so there is no stale // data. storage.setStagedOnBehalfOf(""); + + // To avoid too many address_info requests, returns from each + // address_info request are cached. If the user is doing + // a registrationPoll, it means the user was registering the address + // and the registration has completed. Because the status is + // "complete" or "known", we know that the address is known, so we + // toggle the field to be up to date. If the known field remains + // false, then the user is redirected back to the authentication + // page and the system thinks the address must be verified again. + if(addressCache[email]) { + addressCache[email].known = true; + } + if (onSuccess) { onSuccess(status); } diff --git a/resources/static/test/cases/controllers/check_registration.js b/resources/static/test/cases/controllers/check_registration.js index c852f17d784b7dc3604d2944d135adaa995b0835..d24c8efc92ec8da04e6fffb691ae9270396d3361 100644 --- a/resources/static/test/cases/controllers/check_registration.js +++ b/resources/static/test/cases/controllers/check_registration.js @@ -50,7 +50,7 @@ asyncTest("user validation with mustAuth result", function() { xhr.useResult("mustAuth"); - testVerifiedUserEvent("auth", "User Must Auth"); + testVerifiedUserEvent("authenticate", "User Must Auth"); }); asyncTest("user validation with pending->complete result ~3 seconds", function() {