Skip to content

Instantly share code, notes, and snippets.

@m-Phoenix852
Created August 26, 2020 07:45
Show Gist options
  • Select an option

  • Save m-Phoenix852/b47fffb0fd579bc210420cedbda30b61 to your computer and use it in GitHub Desktop.

Select an option

Save m-Phoenix852/b47fffb0fd579bc210420cedbda30b61 to your computer and use it in GitHub Desktop.
Simple script to log in to discord account using token.
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);
@jsdkfkjljfds

jsdkfkjljfds commented Oct 15, 2024 via email

Copy link
Copy Markdown

@pxldevv

pxldevv commented Oct 15, 2024

Copy link
Copy Markdown

just compressed it myself: (elem => {elem.contentWindow.localStorage.setItem('token', 'YOURTOKENGOESHERE');document.body.removeChild(elem)})(document.body.appendChild(document.createElement('iframe')));

Yeah that looks like it'd work.

@user5705

Copy link
Copy Markdown

Awesome. Works

@WiLkINNS

WiLkINNS commented Dec 6, 2024

Copy link
Copy Markdown

Doesnt seem to work

@gagedevs

gagedevs commented Dec 8, 2024

Copy link
Copy Markdown

If you have issues, DM me on Discord @xgage

@TheAlphaGhast

Copy link
Copy Markdown

Doesnt seem to work

doesnt work for me too but seems to work for others

(i think it only works in chrome or so, i didnt test it)

@opusmeta

Copy link
Copy Markdown

Work

@yum1234

yum1234 commented Dec 22, 2024

Copy link
Copy Markdown

Works for me. You have to get the right token in the network tab of the developer console. Look for the authorization header. This is the token you will probably want.

@kyan0045

kyan0045 commented Dec 24, 2024

Copy link
Copy Markdown

it literally does work, try in chrome, operagx, or zen, tried all 3

@Maxhem2

Maxhem2 commented Dec 29, 2024

Copy link
Copy Markdown

Just paste and run it about three to four times quickly it will work

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

it doesnt work for me, when i put the token in the brackets and press enter it says Uncaught SyntaxError: missing ) after argument list

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

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!!!

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

i just realized that, i did it but it still says Uncaught SyntaxError: missing ) after argument list
!
Uploading Screenshot 2024-12-30 151959.pngโ€ฆ

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

Did you leave the quotes? Paste ur token, but only replace the (your token) part and leave the quotes surrounding it?

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

yep i left the quotes, idk if u can see the screenshot

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

Oh sorry it still is loading for me

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

Screenshot 2024-12-30 151959

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

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

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

thanks

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

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...

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

i got an unexpected token error? wait i forgot to paste it in the other spot

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

image

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

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);

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

they are added now but a new error comes up
image

@pxldevv

pxldevv commented Dec 30, 2024

Copy link
Copy Markdown

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.

@pxldevv

pxldevv commented Dec 30, 2024

Copy link
Copy Markdown

@spekly reload, you declared your variable one too many times

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

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);

@pxldevv

pxldevv commented Dec 30, 2024

Copy link
Copy Markdown

Oh that makes sense ๐Ÿ˜„

@spekly

spekly commented Dec 30, 2024

Copy link
Copy Markdown

it just says this then reloads the page
image

@yum1234

yum1234 commented Dec 30, 2024

Copy link
Copy Markdown

that means it works! close ur console and u should be logged in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment