-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforgot.html
47 lines (44 loc) · 1.1 KB
/
forgot.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
layout: default
page: forgot
---
<h2>You forgot your password?</h2>
<form onsubmit="queryPassword(event)">
<input placeholder="Your email" type="email" id="email"
pattern=".+@*" size="50" required>
<input type='submit' name='Submit' value='Submit' />
</form>
<script>
function queryPassword(e) {
console.log(e)
e.preventDefault();
var email = $('#email').val();
var path = window.getAPIPath() + "/forgot/"+ email;
console.log(path)
$.ajax({
url: path,
type: "POST",
xhrFields: {
withCredentials: true
},
headers: {
"Access-Control-Allow-Origin": true
},
crossDomain: true,
dataType: "json",
data: {},
success: function(data, status, xfr) {
console.log("Put Success: ", data, status, xfr);
$("form").html("If you have an account with us, you'll recieve an email.")
},
error: function(request, error) {
$("form").html("Sorry, there was an error!")
console.log(
"Put Error: ",
JSON.stringify(error),
JSON.stringify(request)
);
}
});
}
</script>