diff --git a/browserid/static/dialog/controllers/dialog_controller.js b/browserid/static/dialog/controllers/dialog_controller.js index 1d8224aecde9d56e9017f40344da48ac0a83cb3b..924f77cbb3e9e8e5fe6e879f1ed48f85200af6a1 100644 --- a/browserid/static/dialog/controllers/dialog_controller.js +++ b/browserid/static/dialog/controllers/dialog_controller.js @@ -97,7 +97,12 @@ }); hub.subscribe("assertion_generated", function(msg, info) { - self.doAssertionGenerated(info.assertion); + if(info.assertion !== null) { + self.doAssertionGenerated(info.assertion); + } + else { + self.doPickEmail(); + } }); hub.subscribe("email_staged", function(msg, info) { @@ -147,7 +152,7 @@ } }, - doSignIn: function() { + doPickEmail: function() { this.element.pickemail(); }, @@ -192,7 +197,7 @@ syncEmails: function() { var self = this; - user.syncEmails(self.doSignIn.bind(self), + user.syncEmails(self.doPickEmail.bind(self), self.getErrorDialog(BrowserID.Errors.signIn)); }, @@ -202,7 +207,7 @@ user.checkAuthenticationAndSync(function onSuccess() {}, function onComplete(authenticated) { if (authenticated) { - self.doSignIn(); + self.doPickEmail(); } else { self.doAuthenticate(); } diff --git a/browserid/static/dialog/controllers/pickemail_controller.js b/browserid/static/dialog/controllers/pickemail_controller.js index 49e6a018c5268c041dcafbedc97d7c123dc9e52c..7f9a06f3bbc5542ce6ccd425b2c31fd05abb39d8 100644 --- a/browserid/static/dialog/controllers/pickemail_controller.js +++ b/browserid/static/dialog/controllers/pickemail_controller.js @@ -91,7 +91,7 @@ cancelEvent(event); function onComplete() { - if(assertion && animationComplete) { + if(typeof assertion !== "undefined" && animationComplete) { self.close("assertion_generated", { assertion: assertion }); @@ -101,7 +101,7 @@ // Kick of the assertion fetching/keypair generating while we are showing // the animation, hopefully this minimizes the delay the user notices. user.getAssertion(email, function(assert) { - assertion = assert; + assertion = assert || null; onComplete(); }); @@ -160,6 +160,8 @@ } }); + $("body").css("opacity", "1"); + pickEmailState.call(this); },