-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ e36a142 🚀
- Loading branch information
1 parent
f4ad29e
commit 35fb993
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<html> | ||
<head> | ||
<title>Electron Authentication Page | Barry's Live/Testable Twitch examples</title> | ||
<link rel="stylesheet" href="/twitch_misc/style.css" /> | ||
</head> | ||
<body> | ||
<div id="output">Please click this link to continue if not automatically redirected</div> | ||
|
||
<p><a href="https://id.twitch.tv/oauth2/authorize?client_id=hozgh446gdilj5knsrsxxz8tahr3koz&redirect_uri=https%3A%2F%2Fbarrycarlyon.github.io%2Ftwitch_misc%2Fauthentication%2Felectron%2Fwebpage%2F&response_type=token">Login with Twitch</a></a></p> | ||
|
||
<p>For further help checkout the <a href="https://github.com/BarryCarlyon/twitch_misc">Repo</a> or <a href="https://link.twitch.tv/devchat">Join us on Discord</a></p> | ||
|
||
<script type="text/javascript"> | ||
if (document.location.hash && document.location.hash != '') { | ||
var parsedHash = new URLSearchParams(window.location.hash.slice(1)); | ||
if (parsedHash.get('access_token')) { | ||
// try for electron? | ||
window.location.href = `twitch-misc-example://twitchauth/${parsedHash.get('access_token')}`; | ||
// and tidy up | ||
window.location.href = 'https://barrycarlyon.github.io/twitch_misc/authentication/electron/webpage/#safetoclose'; | ||
// and tell the user they can close the page | ||
output.textContent = 'It is safe to close this window'; | ||
} | ||
} else { | ||
// attempt redirect | ||
window.location.href = 'https://id.twitch.tv/oauth2/authorize?client_id=hozgh446gdilj5knsrsxxz8tahr3koz&redirect_uri=https%3A%2F%2Fbarrycarlyon.github.io%2Ftwitch_misc%2Fauthentication%2Felectron%2Fwebpage%2F&response_type=token'; | ||
} | ||
</script> | ||
</body> | ||
</html> |