Make use of api_call
This commit is contained in:
parent
ddfe46e34c
commit
dcc557fd89
1 changed files with 2 additions and 3 deletions
|
@ -229,8 +229,7 @@ var register_form = function() {
|
||||||
// password reset
|
// password reset
|
||||||
var request_reset_form = function() {
|
var request_reset_form = function() {
|
||||||
var data = $("#request_reset_form").serializeObject();
|
var data = $("#request_reset_form").serializeObject();
|
||||||
data["csrf_token"] = $.cookie("csrf_token");
|
api_call("POST", "/api/user/forgot", data, function(result) {
|
||||||
$.post("/api/user/forgot", data, function(result) {
|
|
||||||
if (result["success"] == 1) {
|
if (result["success"] == 1) {
|
||||||
display_message("reset_msg", "success", result["message"]);
|
display_message("reset_msg", "success", result["message"]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -247,7 +246,7 @@ var reset_form = function() {
|
||||||
data["csrf_token"] = $.cookie("csrf_token");
|
data["csrf_token"] = $.cookie("csrf_token");
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
var token = url.substr(url.lastIndexOf("/")+1);
|
var token = url.substr(url.lastIndexOf("/")+1);
|
||||||
$.post("/api/user/forgot/" + token, data, function(result) {
|
api_call("POST", "/api/user/forgot/" + token, data, function(result) {
|
||||||
if (result["success"] == 1) {
|
if (result["success"] == 1) {
|
||||||
display_message("reset_msg", "success", result["message"], function() {
|
display_message("reset_msg", "success", result["message"], function() {
|
||||||
location.href = "/login";
|
location.href = "/login";
|
||||||
|
|
Loading…
Reference in a new issue