Commit 85ac26a6 authored by Fabian-Andree Heidemann's avatar Fabian-Andree Heidemann
Browse files

[password] update password reset to JSON API

parent 533bb6a8
......@@ -58,30 +58,30 @@ define([
}
if (pass1 != pass2) {
Dialog.alert("Your passwords don't match!", {
onClose: function() {
$("#password2").focus();
}
var dialog = Dialog.alert("Your passwords don't match!");
dialog.on("close", function () {
$("#password1").focus();
});
return this;
}
$.post(this.url.dynamic("ajax/setpassword"), {
hash: this.hash,
password: pass1
})
.done(function() {
var d = new Date();
d.setTime(d.getTime() + 30e3);
$.cookie("tmpPass", pass1, {
expires: d
});
window.location.href = self.url.dynamic("/");
}).fail(function(res) {
Dialog.alert(res.responseJSON.message, {
onClose: function() {
}, function (err, data) {
if (err.code !== 200) {
var dialog = Dialog.alert(err.message);
dialog.on("close", function () {
$("#password1").focus();
}
});
});
} else {
var d = new Date();
d.setTime(d.getTime() + 30e3);
$.cookie("tmpPass", pass1, {
expires: d
});
window.location.href = self.url.dynamic("/");
}
});
return this;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment