-
Star
(147)
You must be signed in to star a gist -
Fork
(75)
You must be signed in to fork a gist
-
-
Save m-Phoenix852/b47fffb0fd579bc210420cedbda30b61 to your computer and use it in GitHub Desktop.
let token = "your token"; | |
function login(token) { | |
setInterval(() => { | |
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"` | |
}, 50); | |
setTimeout(() => { | |
location.reload(); | |
}, 2500); | |
} | |
login(token); |
Just paste and run it about three to four times quickly it will work
it doesnt work for me, when i put the token in the brackets and press enter it says Uncaught SyntaxError: missing ) after argument list
it doesnt work for me, when i put the token in the brackets and press enter it says Uncaught SyntaxError: missing ) after argument list
You have to put it in the quote at the first line, not the brackets. I tested it like a week ago.
let token = "your token"; #put here!!!
Did you leave the quotes? Paste ur token, but only replace the (your token) part and leave the quotes surrounding it?
yep i left the quotes, idk if u can see the screenshot
Oh sorry it still is loading for me
I think I see the issue...?
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
`"${token}"`
What happened to ' and ' ?
Same for iframe? ' ' is missing
I'm not sure if it disappears, in fact I'll go look in my own editor in a few min
I'll prob ask chatgpt too
thanks
Copy this! there is now a () that covers the iframe.
let token = "your token";
function login(token) {
setInterval(() => {
const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.contentWindow.localStorage.token = `${token}`;
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
let token = "your_token_here"; // Replace with your actual token value
login(token);
Tell me if this works, i think it will help everyone else who has been having issues...
i got an unexpected token error? wait i forgot to paste it in the other spot
The backticks are missing for ${token}
"Use backticks () for embedding variables or expressions, like ${token}`."
is ur editor like deleting the backticks? try inserting them manually
let token = "your token";
function login(token) {
setInterval(() => {
const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.contentWindow.localStorage.token = `${token}`;
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
let token = "your_token_here"; // Replace with your actual token value
login(token);
Yeah @yum1234 is correct, your back ticks are being deleted, if this is an unavoidable issue, I have a one line version you can use as a bookmark.
@spekly reload, you declared your variable one too many times
sorry i accidentally pasted let token twice
let token = "your_token_here"; // Replace with your actual token value
function login(token) {
setInterval(() => {
const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.contentWindow.localStorage.token = `${token}`;
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
login(token);
Oh that makes sense 😄
that means it works! close ur console and u should be logged in
i mean it refreshes the page and the login screen still stays the same, maybe the token is wrong?
Did you get your token from the authorization header? And not from local storage? They are different
how do i get a token from an authorization header?
Have your developer console open, with it switched to the network tab. Log in normally with your credentials. Do anything, and you will see a bunch of network requests pop up. Click on one of them, and switch to the header tab of the network request. Scroll down to authorization. Copy the string (this is your REAL token). (note if you don't see an authorization header please check a different packet. Send a message too and you will see even more network requests)
do i need to be in my account to get this? im trying to get into my old account and all i have is the token, idk if its from local storage or not
@yum1234 actually, i think my token IS from my network tab in console. I've tested using the authorization token to log in with the script and it still doesn't work.
I was in the same boat and to be honest I am not entirely sure. There might be a way to change your token so that its valid. A token is made out of 3 parts. The first part is a user ID. The second part is a timestamp. The third part is a crytographic string representing your username and password. You can very easily get the first and second part. The third part not so much. But if you have the third part, you might be able to manipulate the first and second part.
It seems like discord changed their token structure several times over, and there are many false or i guess old tokens that no longer fit the new system? There isn't much infomation aside from a few advanced programs...
Your old token may contain that third cryptographic part. It is now jsut a matter of modifying it to match the authorization header.
it literally does work, try in chrome, operagx, or zen, tried all 3