summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/site/PasswordForgot.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/ui/site/PasswordForgot.js')
-rw-r--r--public/assets/javascripts/ui/site/PasswordForgot.js26
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..6ac23c0
--- /dev/null
+++ b/public/assets/javascripts/ui/site/PasswordForgot.js
@@ -0,0 +1,26 @@
+var PasswordForgot = ModalFormView.extend({
+ el: ".mediaDrawer.passwordForgot",
+ action: "/auth/passwordForgot",
+
+ 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 = "/"
+ })
+ },
+
+})