diff --git a/resources/js/main.js b/resources/js/main.js index b7c16d9..3e718e5 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -33,24 +33,36 @@ function login(event) { fetch("/login", { method: 'POST', headers: {'Content-Type': 'application/json', + 'Accept': 'application/json', 'X-XSRF-TOKEN': token}, body: JSON.stringify({"email": document.getElementById("login_email").value, "password": document.getElementById("login_password").value}), }).then(response => { - console.log(response.json()) - console.log(response.ok) - console.log(response.status) - console.log(response.statusText) + if (response.ok) { + + } }) event.preventDefault(); } //Attempt to resend the verification link 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(); - } function toggleNav() { diff --git a/resources/scss/main.scss b/resources/scss/main.scss index 2c889b9..2be4306 100644 --- a/resources/scss/main.scss +++ b/resources/scss/main.scss @@ -649,6 +649,7 @@ div.register-area.active { } .info-heading { + text-align: center; margin-top: 3em; margin-left: auto; margin-right: auto;