Skip to content

Latest commit

 

History

History
31 lines (31 loc) · 1.22 KB

login.md

File metadata and controls

31 lines (31 loc) · 1.22 KB
<script> function login() { var email = document.getElementById('email').value; var password = document.getElementById('password').value; var data = {email:email, password:password}; const requestOptions = { method: 'POST', mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'include', // include, *same-origin, omit body: JSON.stringify(data), headers: { "content-type": "application/json", }, }; fetch("https://music.nighthawkcoders.tk/authenticate", requestOptions).then((res) => { if (res.status == 200) { window.location.replace("/team10/users"); } else { document.getElementById('message').innerHTML = "Invalid email or password" } }); } </script>

Login

Email:

Password: