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

Copy link
Copy Markdown

Discord changed it so you get a one time token every time you login, so you have to be connected to the token somewhere else already for it to work

@SuperHarmony910

Copy link
Copy Markdown

https://www.androidauthority.com/get-discord-token-3149920/

this seems to work for me in conjunction with the script

@SuperHarmony910

Copy link
Copy Markdown

also, the first few characters of the localStorage token value, before the colon for me, is the id for never gonna give you up lmao

@xavierskids

Copy link
Copy Markdown

yall are just retarded

@crowwd

crowwd commented Aug 21, 2022

Copy link
Copy Markdown

yall are just retarded

“joined 5 days ago”

@SuperHarmony910

Copy link
Copy Markdown

yall are just retarded

lmao stfu kid

@AamrZahid

Copy link
Copy Markdown

i cant login aswell. This is the error message:
discord.client: logging in using static token
discord.gateway: Shard ID None has connected to Gateway

if someone have the solution please

@NOFY96

NOFY96 commented Sep 17, 2022

Copy link
Copy Markdown

i cant login any tokken from this script

@T0talInsan1ty

Copy link
Copy Markdown

I have been using this token login script for nearly a year now with no issues. However, over the past month or so I have been having the same issue as everyone else here.

You use the token to login, it proceeds to try to login, goes temporarily to discord.com/app but then refreshes back to the login page as if nothing happened.

And yes, I checked to make sure the tokens are right. Really not sure what is causing this.

@stretch07

Copy link
Copy Markdown

just a note to everyone: you can get your token by completing an action such as sending a message, going to the network panel, going to the lowest entry, and getting the authentication or authorization (can't remember which) header from the REQUEST HEADERS(!)

@xavierskids

Copy link
Copy Markdown

its mad easy yall just retarded use your brain lmao

@Aking54

Aking54 commented Oct 3, 2022

Copy link
Copy Markdown

Show us then.

@SuperHarmony910

SuperHarmony910 commented Oct 4, 2022

Copy link
Copy Markdown

just a note to everyone: you can get your token by completing an action such as sending a message, going to the network panel, going to the lowest entry, and getting the authentication or authorization (can't remember which) header from the REQUEST HEADERS(!)

this code also works, also copies it to your clipboard:

window.webpackChunkdiscord_app.push([
  [Math.random()],
  {},
  req => {
    for (const m of Object.keys(req.c)
      .map(x => req.c[x].exports)
      .filter(x => x)) {
      if (m.default && m.default.getToken !== undefined) {
        return copy(m.default.getToken());
      }
      if (m.getToken !== undefined) {
        return copy(m.getToken());
      }
    }
  },
]);
console.log('%cWorked!', 'font-size: 50px');
console.log(`%cYou now have your token in the clipboard!`, 'font-size: 16px');

@stretch07

Copy link
Copy Markdown

yep it does, but I'm not quite used to webpackChunkdiscord_app

@UltraBlackLinux

Copy link
Copy Markdown

thanks for this. Discord has been really stupid and doesn't allow me to change my email. This is good for the time being after I extracted the seemingly never expiring token from the app

@SuperHarmony910

Copy link
Copy Markdown

yep it does, but I'm not quite used to webpackChunkdiscord_app

same heree...

@stretch07

Copy link
Copy Markdown

@SuperHarmony910 man I wish someone would document this. Also is the copy function defined in internal discord?

@TriNotNight

Copy link
Copy Markdown

Is this supposed to work when pasting in console ?

@UltraBlackLinux

Copy link
Copy Markdown

Is this supposed to work when pasting in console ?

yeah, but you can also add that into a bookmark on firefox

@RRTropical

Copy link
Copy Markdown

Yeah nah, doesn't work anymore

@UltraBlackLinux

Copy link
Copy Markdown

I use it daily. It works.

@UltraBlackLinux

Copy link
Copy Markdown

It literally does. No clue what you are doing.

Are you trying this in the web app or the desktop client? Web works for me, and I haven't tested the app

@xavierskids

Copy link
Copy Markdown

xav#0666 for help

@stretch07

Copy link
Copy Markdown

yall are just retarded
use your brain
xav#0666 for help

@xavierskids no one is going to ask you for help lmfao

@lafkpages

Copy link
Copy Markdown

Does not work for me, it just signed me out of all accounts. Seems like the token store does no longer exist because of Account Switcher, so this script no longer works.

@UltraBlackLinux

Copy link
Copy Markdown

Still works (on the web client at least). I don't get why you are all having issues, it works like a charm.

@pxldevv

pxldevv commented Dec 15, 2022

Copy link
Copy Markdown

I know that for me, I have to put the token into the webclient and then spam the command as in this README file

https://github.com/passedout/Discord-Token-Login-Script#discord-token-login-script

@vsamavila

Copy link
Copy Markdown

Have been trying everything on this thread and can't get a single login to work

@UltraBlackLinux

Copy link
Copy Markdown

y'all are using invalid tokens lmao

@RealHeha

RealHeha commented Jan 2, 2023

Copy link
Copy Markdown

it doesnt work lol

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