Advertisement
Guest User

script

a guest
Oct 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function __eq_authenticate(e){e.stopPropagation(),e.preventDefault(),null!==document.getElementById("__eq_authenticate_err")&&(document.getElementById("__eq_authenticate_err").innerText="");var t=document.getElementById("__eq_authenticate");if(null!==t){if(null===t.querySelector('input[name="email"]'))return alert("Email address input not found!"),!1;if(null===t.querySelector('input[name="password"]'))return alert("Password input not found!"),!1;var n={email:t.querySelector('input[name="email"]').value,password:t.querySelector('input[name="password"]').value},a=new XMLHttpRequest;a.open("POST","https://api.equidesk.com/api/auth/login"),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(n)),a.onload=function(){var e=JSON.parse(a.response);2e3===e.status?window.location.href="https://app.equidesk.com/__eq_authenticate/"+e.data.token:7e3===e.status?null!==document.getElementById("__eq_authenticate_err")&&(document.getElementById("__eq_authenticate_err").innerText=e.error):null!==document.getElementById("__eq_authenticate_err")&&(document.getElementById("__eq_authenticate_err").innerText="Invalid Credential. Please check properly!")}}else alert("Identical form not found. Please check your script please.")}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement