Last active
October 27, 2015 08:27
-
-
Save dzmitryk/0a75b6ccde2bcaa77d44 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>OAuth code</title> | |
</head> | |
<body> | |
<div> | |
<label for="code">Your authorization code is:</label> | |
<b><span id="code"></span></b> | |
</div> | |
<script language="javascript" type="text/javascript"> | |
var pattern = /[?|&]code=[^&]*/; | |
var codeElement = document.getElementById('code'); | |
pattern.test(document.URL) ? | |
codeElement.innerHTML = pattern.exec(document.URL)[0].substring(6) : codeElement.innerHTML = 'No code specified'; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment