diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js index 9b45226a8bd7edd48804a6b57e1219e4e187cf1b..b5d297d073a1c7ed5fc8485be006cc9ed2e750c4 100644 --- a/browserid/static/dialog/controllers/authenticate_controller.js +++ b/browserid/static/dialog/controllers/authenticate_controller.js @@ -169,8 +169,15 @@ resetPassword: function() { var email = $("#email").val(); - this.close("reset_password", { - email: email + var me=this; + network.requestPasswordReset(email, function(reset) { + if (reset) { + me.close("reset_password", { + email: email + }); + } + }, function onFailure() { + }); } }); diff --git a/browserid/static/dialog/resources/browserid-network.js b/browserid/static/dialog/resources/browserid-network.js index 714a17fd5c0aebcb8ce464cb73c658f7d5ba2f42..9cdaf01aaa495c51a688d4adaf54ed9cd9cab173 100644 --- a/browserid/static/dialog/resources/browserid-network.js +++ b/browserid/static/dialog/resources/browserid-network.js @@ -242,9 +242,7 @@ var BrowserIDNetwork = (function() { requestPasswordReset: function(email, onSuccess, onFailure) { // XXX fill this in. if (email) { - if (onSuccess) { - _.defer(onSuccess); - } + this.createUser(email, onSuccess, onFailure); } },