Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Commit

Permalink
Ensure the userid is set after completing any sort of address verific…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
Shane Tomlinson committed Apr 3, 2013
1 parent 5402de1 commit ec47da2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resources/static/common/js/user.js
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions resources/static/test/cases/common/js/user.js
Expand Up @@ -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();
Expand Down

0 comments on commit ec47da2

Please sign in to comment.