Browse Source

Finish function for resending verification link

tags/v0.1.0
Immanuel Onyeka 3 years ago
parent
commit
2696110cc2
2 changed files with 19 additions and 6 deletions
  1. +18
    -6
      resources/js/main.js
  2. +1
    -0
      resources/scss/main.scss

+ 18
- 6
resources/js/main.js View File

@@ -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() {


+ 1
- 0
resources/scss/main.scss View File

@@ -649,6 +649,7 @@ div.register-area.active {
} }


.info-heading { .info-heading {
text-align: center;
margin-top: 3em; margin-top: 3em;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;


Loading…
Cancel
Save