|
@@ -33,24 +33,36 @@ function login(event) { |
|
|
fetch("/login", { |
|
|
fetch("/login", { |
|
|
method: 'POST', |
|
|
method: 'POST', |
|
|
headers: {'Content-Type': 'application/json', |
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
|
|
'Accept': 'application/json', |
|
|
'X-XSRF-TOKEN': token}, |
|
|
'X-XSRF-TOKEN': token}, |
|
|
body: JSON.stringify({"email": |
|
|
body: JSON.stringify({"email": |
|
|
document.getElementById("login_email").value, |
|
|
document.getElementById("login_email").value, |
|
|
"password": document.getElementById("login_password").value}), |
|
|
"password": document.getElementById("login_password").value}), |
|
|
}).then(response => { |
|
|
}).then(response => { |
|
|
console.log(response.json()) |
|
|
|
|
|
console.log(response.ok) |
|
|
|
|
|
console.log(response.status) |
|
|
|
|
|
console.log(response.statusText) |
|
|
|
|
|
|
|
|
if (response.ok) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Attempt to resend the verification link |
|
|
//Attempt to resend the verification link |
|
|
function resendLink(event) { |
|
|
function resendLink(event) { |
|
|
console.log("clicked"); |
|
|
|
|
|
|
|
|
fetch("/resend-verification", { |
|
|
|
|
|
method: 'POST', |
|
|
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
|
|
'Accept': 'application/json', |
|
|
|
|
|
'X-XSRF-TOKEN': token}, |
|
|
|
|
|
}).then(response => { |
|
|
|
|
|
if (response.ok) { |
|
|
|
|
|
event.target.parentNode.getElementsByTagName('h3')[0].innerText = |
|
|
|
|
|
"The link has been resent." |
|
|
|
|
|
} else { |
|
|
|
|
|
event.target.parentNode.getElementsByTagName('h3')[0].innerText = |
|
|
|
|
|
`${response.status} : ${response.statusText}` |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function toggleNav() { |
|
|
function toggleNav() { |
|
|