Skip to content

Commit

Permalink
Deploying to gh-pages from @ 546876b 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryCarlyon committed Aug 8, 2023
1 parent 3fff0b3 commit b031ef7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions authentication/electron/webpage/index.html
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>

0 comments on commit b031ef7

Please sign in to comment.