diff --git a/resources/static/dialog/controllers/check_registration.js b/resources/static/dialog/controllers/check_registration.js index cc7fdf53ed7c68f1e67779c855f95d21c5bc0588..f6929b6fa64e842359f26be96a9a6c9b978120b8 100644 --- a/resources/static/dialog/controllers/check_registration.js +++ b/resources/static/dialog/controllers/check_registration.js @@ -39,7 +39,10 @@ BrowserID.Modules.CheckRegistration = (function() { }); } else if (status === "mustAuth") { - self.close("authenticate", { email: self.email }); + user.addressInfo(self.email, function(info) { + self.close("authenticate", info); + }); + oncomplete && oncomplete(); } }, self.getErrorDialog(errors.registration, oncomplete)); diff --git a/resources/static/dialog/resources/state.js b/resources/static/dialog/resources/state.js index 6dfa32485ce929e54ebfe992a0efdc95b4b0af00..aba9e7c81820f22d5110becfa2dd1a5c3f0cdb72 100644 --- a/resources/static/dialog/resources/state.js +++ b/resources/static/dialog/resources/state.js @@ -241,6 +241,8 @@ BrowserID.State = (function() { handleState("reset_password", function(msg, info) { // reset password says the password has been reset, now waiting for // confirmation. + info = info || {}; + self.stagedEmail = info.email; startAction(false, "doResetPassword", info); }); diff --git a/resources/static/test/cases/controllers/check_registration.js b/resources/static/test/cases/controllers/check_registration.js index d24c8efc92ec8da04e6fffb691ae9270396d3361..16fe3dfbea1956815af50d9c164b5dbbb2378171 100644 --- a/resources/static/test/cases/controllers/check_registration.js +++ b/resources/static/test/cases/controllers/check_registration.js @@ -49,6 +49,14 @@ asyncTest("user validation with mustAuth result", function() { xhr.useResult("mustAuth"); + createController("waitForUserValidation"); + register("authenticate", function(msg, info) { + equal(info.email, "registered@testuser.com", "correct email"); + ok(info.type, "type sent with info"); + ok(info.known, "email is known"); + start(); + }); + controller.startCheck(); testVerifiedUserEvent("authenticate", "User Must Auth"); }); diff --git a/resources/static/test/cases/resources/state.js b/resources/static/test/cases/resources/state.js index 1c32995418eb58c6e2c785a5530d5a8bd791f23b..b620cdf598dbe85f3965123ff82e95e598c1a551 100644 --- a/resources/static/test/cases/resources/state.js +++ b/resources/static/test/cases/resources/state.js @@ -218,6 +218,14 @@ equal(actions.info.doAuthenticate.email, TEST_EMAIL, "authenticate called with the correct email"); }); + test("reset_password through to validation on same browser - call doEmailConfirmed with email address", function() { + mediator.publish("reset_password", { email: TEST_EMAIL }); + mediator.publish("user_confirmed"); + + equal(actions.info.doEmailConfirmed.email, TEST_EMAIL, "doEmailConfirmed called with correct email"); + }); + + asyncTest("assertion_generated with null assertion - redirect to pick_email", function() { mediator.subscribe("pick_email", function() { ok(true, "redirect to pick_email"); diff --git a/resources/static/test/mocks/xhr.js b/resources/static/test/mocks/xhr.js index 7ff902b893270b62b6916fdbff90848cb4a8c4b8..fa8f8e700f6662558568956e3596d91aca3bd948 100644 --- a/resources/static/test/mocks/xhr.js +++ b/resources/static/test/mocks/xhr.js @@ -109,6 +109,7 @@ BrowserID.Mocks.xhr = (function() { "get /wsapi/address_info?email=unregistered%40testuser.com primary": { type: "primary", auth: "https://auth_url", prov: "https://prov_url" }, "get /wsapi/address_info?email=testuser%40testuser.com unknown_secondary": { type: "secondary", known: false }, "get /wsapi/address_info?email=testuser%40testuser.com known_secondary": { type: "secondary", known: true }, + "get /wsapi/address_info?email=registered%40testuser.com mustAuth": { type: "secondary", known: true }, "get /wsapi/address_info?email=testuser%40testuser.com primary": { type: "primary", auth: "https://auth_url", prov: "https://prov_url" }, "get /wsapi/address_info?email=testuser%40testuser.com ajaxError": undefined, "post /wsapi/add_email_with_assertion invalid": { success: false },