blob: 9b87d37691a6f66975526975b8fb6b01955add9c (
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
26
27
28
29
30
31
|
var PasswordReset = ModalFormView.extend({
el: ".mediaDrawer.passwordReset",
action: "/auth/password",
load: function(){
var opt = JSON.parse( $("#opt").html() )
this.$("[name=nonce]").val( opt.nonce )
this.__super__.load.call(this)
},
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"
}
})
|