Created
February 17, 2018 19:49
-
-
Save ImreC/754332b3f17af8baa82a90ea1b44c063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p id = "info"> | |
Sending token | |
</p> | |
<script> | |
var url = new URL(window.location.href); | |
var token = url.searchParams.get("token"); | |
var obj = { | |
action: 'verifySignupLong', | |
value: token | |
} | |
console.log(JSON.stringify(obj)) | |
console.log(obj) | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function() { | |
if (this.readyState == 4 && this.status == 201) { | |
// Typical action to be performed when the document is ready: | |
document.getElementById("info").innerHTML = 'Verification Successful for action <b>' + obj.action + '</b> and token <b>' + obj.value + '</b>'; | |
} else { | |
document.getElementById("info").innerHTML = xhttp.response | |
} | |
}; | |
xhttp.open('POST', 'http://localhost:3030/authmanagement' , true); | |
xhttp.setRequestHeader('Content-Type', 'application/json'); | |
xhttp.send(JSON.stringify(obj)); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment