this should fix it
This commit is contained in:
parent
4d7c437b25
commit
4dc6f95e84
1 changed files with 15 additions and 8 deletions
|
|
@ -3,16 +3,23 @@ import "./reviewed.css";
|
|||
import { sendReview } from "../src/components/api";
|
||||
|
||||
export default function App() {
|
||||
const token = window.location.hash
|
||||
.substring(
|
||||
window.location.hash.indexOf("access_token") + "access_token".length + 1,
|
||||
)
|
||||
.substring(0, 30);
|
||||
console.log(token);
|
||||
if (token === "") {
|
||||
const hash = window.location.hash;
|
||||
|
||||
const hashContent = hash.startsWith('#') ? hash.substring(1) : hash;
|
||||
|
||||
const params = new URLSearchParams(hashContent);
|
||||
|
||||
const token = params.get('access_token')!;
|
||||
|
||||
if (token) {
|
||||
console.log("Access Token:", token);
|
||||
// Do something with your token
|
||||
} else {
|
||||
console.log("Access Token not found in hash.");
|
||||
window.location.href =
|
||||
"https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Famy.rip%2Freview%2F&scope=identify";
|
||||
"https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Famy.rip%2Freview%2F&scope=identify";
|
||||
}
|
||||
console.log(token);
|
||||
let ref!: HTMLTextAreaElement;
|
||||
return (
|
||||
<div class="reviewOuterparent">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue