diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-07-17 12:18:45 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-07-17 12:18:45 -0400 |
| commit | 4ee827ad464dfa0edb664d27e5069811877deb1e (patch) | |
| tree | 69c6ecb890a6af7f6c247c74f81bc36db591e970 /public/assets/javascripts/ui/site/PasswordForgot.js | |
| parent | b97f3d39ac0e387385aae2685dbe830ee53a686c (diff) | |
| parent | f20841988ccd27780d3801e4a6c32bf9afcc9368 (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/ui/site/PasswordForgot.js')
| -rw-r--r-- | public/assets/javascripts/ui/site/PasswordForgot.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/site/PasswordForgot.js b/public/assets/javascripts/ui/site/PasswordForgot.js new file mode 100644 index 0000000..ecbfc07 --- /dev/null +++ b/public/assets/javascripts/ui/site/PasswordForgot.js @@ -0,0 +1,26 @@ +var PasswordForgot = ModalFormView.extend({ + el: ".mediaDrawer.passwordForgot", + action: "/auth/forgotPassword", + + validate: function(){ + var errors = [] + + var email = this.$("#emailInput").val() + + if (! email.length) { + errors.push("Please enter your email address"); + } + if (email.indexOf("@") === -1) { + errors.push("Sorry, that is not a valid email address"); + } + + return errors + }, + + success: function(res){ + AlertModal.alert("Check your email, you should receive further instructions momentarily.", function(e){ + window.location.href = "/" + }) + }, + +}) |
