-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bacon_Space
authored
Oct 7, 2023
1 parent
0215804
commit 140ae1f
Showing
1 changed file
with
31 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,31 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Twitch Authentication Redirect</title> | ||
</head> | ||
<body> | ||
<h1>Redirecting...</h1> | ||
<script> | ||
// Replace with your Twitch Client ID | ||
const clientId = "5i1dxwe52zbj0tra8evwmm4m1b7clz1"; | ||
|
||
// Check if the URL contains an access token | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const accessToken = urlParams.get("access_token"); | ||
|
||
if (accessToken) { | ||
// Access token is present, save it to localStorage for later use | ||
localStorage.setItem("twitch_access_token", accessToken); | ||
|
||
// Redirect back to your main page | ||
window.location.href = "https://streamstats.github.io/twitch/"; // Update to your main page URL | ||
} else { | ||
// No access token found, handle the error or redirect to an error page | ||
console.error("No access token found."); | ||
// You can redirect to an error page here if needed | ||
} | ||
</script> | ||
</body> | ||
</html> |