Skip to content
Snippets Groups Projects
Commit f9fc0801 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #1455 from mozilla/pr_1447_cancel_state

Pr 1447 cancel state
parents c24096db 0d3a0317
No related branches found
No related tags found
No related merge requests found
......@@ -70,9 +70,7 @@ BrowserID.Modules.Actions = (function() {
},
doCancel: function() {
// do not call success with null here, let winchan's cancel handling do the work.
// this gives us consistent semantics across browsers on the RP side of the WinChan.
// if(onsuccess) onsuccess(null);
if(onsuccess) onsuccess(null);
},
doConfirmUser: function(info) {
......
......@@ -91,7 +91,10 @@ BrowserID.Modules.RequiredEmail = (function() {
function cancel() {
this.close(secondaryAuth ? "cancel_state" : "cancel");
// The cancel button is only shown to a user who has to enter their
// password to go from "assertion" authentication to "password"
// authentication.
this.close("cancel_state");
}
var RequiredEmail = bid.Modules.PageModule.extend({
......
......@@ -62,7 +62,9 @@ BrowserID.State = (function() {
handleState("window_unload", function() {
if (!self.success) {
storage.setStagedOnBehalfOf("");
startAction("doCancel");
// do not call doCancel here, let winchan's cancel
// handling do the work. This gives us consistent semantics
// across browsers on the RP side of the WinChan.
}
});
......
......@@ -454,24 +454,7 @@
});
});
asyncTest("cancel normally raises the 'cancel' message", function() {
var email = "registered@testuser.com",
message = "cancel";
createController({
email: email,
ready: function() {
register(message, function(item, info) {
ok(true, message + " received");
start();
});
controller.cancel();
}
});
});
asyncTest("cancel with 'secondary_auth' raises the 'cancel_state' message", function() {
asyncTest("cancel raises the 'cancel_state' message", function() {
var email = "registered@testuser.com",
message = "cancel_state";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment