easyctf-2017/web/js/login.js
2015-12-24 19:57:58 -05:00

16 lines
404 B
JavaScript

$("#login-form").on("submit", function(e) {
e.preventDefault();
login($("#email").val(), $("#password").val());
});
function login(email, password) {
$.post("/api/user/login", {
email: email,
password: password
}, function(data) {
$("#status").text(data.message);
if (data.success == 1) {
// wait then redirect or whatever
}
});
}