Permalink
Browse files

Ensure the userid is set after completing any sort of address verific…

…ation.
  • Loading branch information...
1 parent 5402de1 commit ec47da230a461f3ff8c0e2345065011cd40bb75a @shane-tomlinson shane-tomlinson committed Apr 3, 2013
Showing with 7 additions and 2 deletions.
  1. +5 −2 resources/static/common/js/user.js
  2. +2 −0 resources/static/test/cases/common/js/user.js
@@ -160,8 +160,8 @@ BrowserID.User = (function() {
// completed verification. See issue #1682
// https://github.com/mozilla/browserid/issues/1682
User.authenticate(stagedEmail, stagedPassword, function(authenticated) {
- // The address verification poll does not send back a userid if
- // the status is mustAuth. use the userid set in onContextChange.
+ // The address verification poll does not send back a userid.
+ // Use the userid set in User.authenticate
resp.userid = userid;
resp.status = authenticated ? "complete" : "mustAuth";
completeVerification(resp);
@@ -187,6 +187,9 @@ BrowserID.User = (function() {
if (resp.status === "complete" && authStatus !== "password")
resp.status = "mustAuth";
+ // The address verification poll does not send back a userid.
+ // use the userid set in onContextChange.
+ resp.userid = userid;
completeVerification(resp);
}, onFailure);
}
@@ -169,6 +169,8 @@
// synced_address should be added as a result of syncing email addresses
// when the verification poll completes.
if (expectedResult === "complete") {
+ // after completion, the userid must be set. See issue #3172
+ ok(lib.userid());
testHelpers.testAddressesSyncedAfterUserRegistration();
}
start();

0 comments on commit ec47da2

Please sign in to comment.