From dcc557fd899f74f2fc2dfb1a8f0abe4c93b96e5a Mon Sep 17 00:00:00 2001 From: James Wang Date: Sat, 16 Jan 2016 23:13:41 +0000 Subject: [PATCH] Make use of api_call --- web/js/easyctf.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/js/easyctf.js b/web/js/easyctf.js index 30e4499..da90c05 100644 --- a/web/js/easyctf.js +++ b/web/js/easyctf.js @@ -229,8 +229,7 @@ var register_form = function() { // password reset var request_reset_form = function() { var data = $("#request_reset_form").serializeObject(); - data["csrf_token"] = $.cookie("csrf_token"); - $.post("/api/user/forgot", data, function(result) { + api_call("POST", "/api/user/forgot", data, function(result) { if (result["success"] == 1) { display_message("reset_msg", "success", result["message"]); } else { @@ -247,7 +246,7 @@ var reset_form = function() { data["csrf_token"] = $.cookie("csrf_token"); var url = window.location.href; 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) { display_message("reset_msg", "success", result["message"], function() { location.href = "/login";