diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js index 0054f37c37efc626e98afa6d5eccc40c7a86089b..84632f5f3008fe152f92d6c27a29a3b22899e047 100644 --- a/browserid/static/dialog/controllers/authenticate_controller.js +++ b/browserid/static/dialog/controllers/authenticate_controller.js @@ -40,6 +40,7 @@ var ANIMATION_TIME = 250, bid = BrowserID, user = bid.User, + errors = bid.Errors, validation = bid.Validation, lastEmail = ""; @@ -60,7 +61,7 @@ else { createUserState.call(self); } - }); + }, self.getErrorDialog(errors.isEmailRegistered)); } function createUser(el, event) { @@ -83,7 +84,7 @@ else { // XXX can't register this email address. } - }, self.getErrorDialog(bid.Errors.createAccount)); + }, self.getErrorDialog(errors.createUser)); } function authenticate(el, event) { @@ -106,10 +107,7 @@ } else { bid.Tooltip.showTooltip("#cannot_authenticate"); } - }, - self.getErrorDialog(bid.Errors.authentication) - ); - + }, self.getErrorDialog(errors.authenticate)); } function resetPassword(el, event) { @@ -122,9 +120,7 @@ self.close("reset_password", { email: email }); - }, function() { - // XXX TODO error screen! - }); + }, self.getErrorDialog(errors.requestPasswordReset)); } function animateSwap(fadeOutSelector, fadeInSelector, callback) { diff --git a/browserid/static/dialog/resources/error-messages.js b/browserid/static/dialog/resources/error-messages.js index 860760fb88febb0e2645a94dda23b3cf7f314b5f..2549941dc02fca1c091dd47ac703d04973495b11 100644 --- a/browserid/static/dialog/resources/error-messages.js +++ b/browserid/static/dialog/resources/error-messages.js @@ -36,7 +36,7 @@ BrowserID.Errors = (function(){ "use strict"; var Errors = { - authentication: { + authenticate: { type: "serverError", title: "Error Authenticating", message: "There was a technical problem while trying to log you in. Yucky!" @@ -54,7 +54,13 @@ BrowserID.Errors = (function(){ message: "There was a technical problem while trying to log you in. Yucky!" }, - createAccount: { + isEmailRegistered: { + type: "serverError", + title: "Error Checking Email Address", + message: "There was a technical problem while trying to check that email address. Yucky!" + }, + + createUser: { type: "serverError", title: "Error Creating Account", message: "There was a technical problem while trying to create your account. Yucky!" @@ -66,6 +72,12 @@ BrowserID.Errors = (function(){ message: "An error was encountered and the signup cannot be completed. Yucky!" }, + requestPasswordReset: { + type: "serverError", + title: "Error Resetting Password", + message: "There was a technical problem while trying to reset your password." + }, + signIn: { type: "serverError", title: "Signin Failed",