summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/site/PasswordReset.js
blob: 77e8684f42825423a796418c909d2f2f1a43f64d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var PasswordReset = ModalFormView.extend({
	el: ".mediaDrawer.passwordReset",
	action: "/auth/password",

	validate: function(){
		var errors = []
		
		var pw1 = this.$("#passwordInput1").val()
		var pw2 = this.$("#passwordInput2").val()

		if (! pw1.length) {
			errors.push("Please enter a password");
		}
		if (pw1 !== pw2) {
			errors.push("Passwords don't match");
		}

		return errors
	},

	success: function(res){
		window.location.href = "/profile"
	}

})