Skip to content

Instantly share code, notes, and snippets.

@m-Phoenix852
Last active February 14, 2024 13:31
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save m-Phoenix852/d63d869f16e40dac623c9aa347e8641a to your computer and use it in GitHub Desktop.
Save m-Phoenix852/d63d869f16e40dac623c9aa347e8641a to your computer and use it in GitHub Desktop.
Userscript to login to discord accounts with ease, just do SHIFT + T at the login page and enter the token!
// ==UserScript==
// @name Discord Token Login
// @namespace https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/
// @version 1.1
// @description Taking over discord's tokens!
// @author Phoenix852
// @match *://discord.com/login
// @updateURL https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/raw/6d1ee63df17685e4ea06018bd8b47541d4261b82/index.user.js
// @grant none
// @iconURL https://i.imgur.com/rI8GsTz.png
// @run-at document-start
// ==/UserScript==
(function(){
console.log("Dicord Token Login ready!");
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
document.addEventListener("keydown", (event) => {
if(event.shiftKey && event.keyCode === 84) {
if(!["https://discord.com/login", "http://discord.com/login"].includes(window.location.href)) return;
console.log("Prompting for token...");
let token = prompt("Give the token");
if(!token) { console.log("No token provided. Aborting!"); return; }
login(token);
}
});
})();
@Roshane-Johnson
Copy link

not working

what's wrong

It's not working for me either. Installed 100% properly. The red dot appears on Tampermonkeys extension whenever in Discord but pressing Shift+T wont do anything.

Nevermind -Facepalm- Its working fine! You just can't be logged into an account at the time!

I was sooo confused lmao

@iMumbled
Copy link

iMumbled commented Mar 5, 2021

does it work with mfa tokens

@sarrywehbe2
Copy link

hey man what do i do if it just reloads and doesnt log me in? fo i have to be logged out of the discord app as well? because im not logged into the browser one and its not working. pls help

@m-Phoenix852
Copy link
Author

hey man what do i do if it just reloads and doesnt log me in? fo i have to be logged out of the discord app as well? because im not logged into the browser one and its not working. pls help

the token is invalid then

@sarrywehbe2
Copy link

sarrywehbe2 commented Mar 23, 2021 via email

Copy link

ghost commented Mar 24, 2021

hey man what do i do if it just reloads and doesnt log me in? fo i have to be logged out of the discord app as well? because im not logged into the browser one and its not working. pls help

the token is invalid then

I tried it too and it didn't work.
Do I also have to be logged out of the app? It always goes in the loading screen and then back to the login and the console says DevTools failed to load SourceMap: Could not load content for https://discord.com/assets/385f26386d4dce43352d.js.map: HTTP error: status code 404, net :: ERR_HTTP_RESPONSE_CODE_FAILURE
Ps. I'm pretty sure that the token is valid.

@m-Phoenix852
Copy link
Author

m-Phoenix852 commented Mar 24, 2021

hey man what do i do if it just reloads and doesnt log me in? fo i have to be logged out of the discord app as well? because im not logged into the browser one and its not working. pls help

the token is invalid then

I tried it too and it didn't work.
Do I also have to be logged out of the app? It always goes in the loading screen and then back to the login and the console says DevTools failed to load SourceMap: Could not load content for https://discord.com/assets/385f26386d4dce43352d.js.map: HTTP error: status code 404, net :: ERR_HTTP_RESPONSE_CODE_FAILURE
Ps. I'm pretty sure that the token is valid.

weird, I tried to login and it works. And no you don't need to be logged out of the app, tell me what you did so that I can recreate the error.

Use the userscript btw

@Spitfire557
Copy link

this one where u log in with the token work but it like doesn't actually log me in. where do i get the token from though cause i think that might be the issue

@Spitfire557
Copy link

works perfectly gg

How did u get the token

@ImmGeoff
Copy link

ImmGeoff commented Apr 8, 2021

Yeah I'm trying to get the token but the website it keeps telling me to go to it only gives half and I need a full one.

@avocado5182
Copy link

its not working, heres my console (i'm using firefox, version 87.0 with tampermonkey, version 4.12.6132):

Dicord Token Login ready! Discord Token Login.user.js:19:13
[FAST CONNECT] wss://gateway.discord.gg/?encoding=json&v=8&compress=zlib-stream, encoding: json, version: 8 login:47:334
[FAST CONNECT] connected in 237ms a690b1b2464598278477.js:2:127631
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071411
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071460
[Logger.tsx] Logger has loaded a690b1b2464598278477.js:2:127631
Cookie “locale” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite 18fb3893c96106f45fa4.js:2:1529470
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071411
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071460
[default] [BUILD INFO] Release Channel: stable, Build Number: 82590, Version Hash: bf3e4f776c9df1f9e3eb9b4c63a1987a0f9a7641 a690b1b2464598278477.js:2:127631
[Flux] Slow batch emitChanges took 158ms recentActions: EXPERIMENT_REGISTER_LEGACY -> I18N_LOAD_START -> STREAMING_UPDATE -> ACCESSIBILITY_SYSTEM_PREFERS_REDUCED_MOTION_CHANGED -> I18N_LOAD_SUCCESS a690b1b2464598278477.js:2:127631
[Flux] Slow dispatch on I18N_LOAD_SUCCESS: 164ms a690b1b2464598278477.js:2:127631
[AuthenticationStore] handleLogout called. 
Object { tokenManagerHasToken: true, storageHasToken: true }
a690b1b2464598278477.js:2:127631
[AuthenticationStore] removeAuthToken called. 
Object { tokenManagerHasToken: true, storageHasToken: true }
a690b1b2464598278477.js:2:127631
[GatewaySocket] Closing connection, current state is 0 a690b1b2464598278477.js:2:127631
[Routing/Utils] Transitioning to /login a690b1b2464598278477.js:2:127631
[GatewaySocket] [RESET] (true, 1000, Disconnect requested by user) a690b1b2464598278477.js:2:127631
[AuthenticationStore] handleConnectionClosed called with code 1000. 
Object { tokenManagerHasToken: false, storageHasToken: false }
a690b1b2464598278477.js:2:127631
[Routing/Utils] Transitioning to /app a690b1b2464598278477.js:2:127631
[LoginQRSocket] [0ms] connecting to wss://remote-auth-gateway.discord.gg/?v=1 a690b1b2464598278477.js:2:127631
[LoginQRSocket] [477ms] got hello, auth timeout=600000ms a690b1b2464598278477.js:2:127631
[LoginQRSocket] [878ms] connected, handshaking with fingerprint: YBd9dJKVhVJ7TpL43gYTs_ikQOieJCdhiwZmOOJqMWg a690b1b2464598278477.js:2:127631
[LoginQRSocket] [943ms] computed nonce proof a690b1b2464598278477.js:2:127631
[LoginQRSocket] [989ms] handshake complete awaiting remote auth. a690b1b2464598278477.js:2:127631

@IceWaltz
Copy link

IceWaltz commented May 2, 2021

Works like a charm, Cheers!

@m-Phoenix852
Copy link
Author

its not working, heres my console (i'm using firefox, version 87.0 with tampermonkey, version 4.12.6132):

Dicord Token Login ready! Discord Token Login.user.js:19:13
[FAST CONNECT] wss://gateway.discord.gg/?encoding=json&v=8&compress=zlib-stream, encoding: json, version: 8 login:47:334
[FAST CONNECT] connected in 237ms a690b1b2464598278477.js:2:127631
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071411
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071460
[Logger.tsx] Logger has loaded a690b1b2464598278477.js:2:127631
Cookie “locale” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite 18fb3893c96106f45fa4.js:2:1529470
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071411
unreachable code after return statement
18fb3893c96106f45fa4.js:2:3071460
[default] [BUILD INFO] Release Channel: stable, Build Number: 82590, Version Hash: bf3e4f776c9df1f9e3eb9b4c63a1987a0f9a7641 a690b1b2464598278477.js:2:127631
[Flux] Slow batch emitChanges took 158ms recentActions: EXPERIMENT_REGISTER_LEGACY -> I18N_LOAD_START -> STREAMING_UPDATE -> ACCESSIBILITY_SYSTEM_PREFERS_REDUCED_MOTION_CHANGED -> I18N_LOAD_SUCCESS a690b1b2464598278477.js:2:127631
[Flux] Slow dispatch on I18N_LOAD_SUCCESS: 164ms a690b1b2464598278477.js:2:127631
[AuthenticationStore] handleLogout called. 
Object { tokenManagerHasToken: true, storageHasToken: true }
a690b1b2464598278477.js:2:127631
[AuthenticationStore] removeAuthToken called. 
Object { tokenManagerHasToken: true, storageHasToken: true }
a690b1b2464598278477.js:2:127631
[GatewaySocket] Closing connection, current state is 0 a690b1b2464598278477.js:2:127631
[Routing/Utils] Transitioning to /login a690b1b2464598278477.js:2:127631
[GatewaySocket] [RESET] (true, 1000, Disconnect requested by user) a690b1b2464598278477.js:2:127631
[AuthenticationStore] handleConnectionClosed called with code 1000. 
Object { tokenManagerHasToken: false, storageHasToken: false }
a690b1b2464598278477.js:2:127631
[Routing/Utils] Transitioning to /app a690b1b2464598278477.js:2:127631
[LoginQRSocket] [0ms] connecting to wss://remote-auth-gateway.discord.gg/?v=1 a690b1b2464598278477.js:2:127631
[LoginQRSocket] [477ms] got hello, auth timeout=600000ms a690b1b2464598278477.js:2:127631
[LoginQRSocket] [878ms] connected, handshaking with fingerprint: YBd9dJKVhVJ7TpL43gYTs_ikQOieJCdhiwZmOOJqMWg a690b1b2464598278477.js:2:127631
[LoginQRSocket] [943ms] computed nonce proof a690b1b2464598278477.js:2:127631
[LoginQRSocket] [989ms] handshake complete awaiting remote auth. a690b1b2464598278477.js:2:127631

no idea

@upsilun
Copy link

upsilun commented May 4, 2021

This no longer works now. They have changed the login system, as any person who logs out changes the token directly, and the old token will not work, in this case The token owner must be using Discord at the same time then it will work

@mmccall0813
Copy link

This no longer works now. They have changed the login system, as any person who logs out changes the token directly, and the old token will not work, in this case The token owner must be using Discord at the same time then it will work

so it does work, but the token gets refreshed if you log out?

@xCancazedd
Copy link

@omarmoussa69
Copy link

Hey, how can I use this script with puppeteer ?

@upsilun
Copy link

upsilun commented May 23, 2021

This no longer works now. They have changed the login system, as any person who logs out changes the token directly, and the old token will not work, in this case The token owner must be using Discord at the same time then it will work

so it does work, but the token gets refreshed if you log out?

yup

@ProxyPing
Copy link

Works fine for me :)

@DevtoolsFelix
Copy link

can this be used with tokens for discord bots you make in the developer page?? When i paste in my bots token it reloads but doesnt log me in with my bot

@xCancazedd
Copy link

xCancazedd commented Jul 11, 2021

can this be used with tokens for discord bots you make in the developer page?? When i paste in my bots token it reloads but doesnt log me in with my bot

if you want to log in with a bots token you'll have to use an app called Discord Bot Client, here is the link https://github.com/Flam3rboy/discord-bot-client

@XfedeX
Copy link

XfedeX commented Jul 12, 2021

Why do i see multiple tokens with tokenlogger but none of them work?
E.G:
tokens:

NTYyMTUwNDE3ODU3OTA0NjQw.YMkWtA.ftgx-dZaant5VSPwIb5XbGxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YNiGLA.CoAq0MsT-KXwC2meQZpXY1xxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YMnnUg.ZVXamHym6v6BzaQzYy61Npxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YOsMOw.KZl7o_QlwYxl6nezWAIKXxxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YOsKGg.2PYqRFeWV9zJApIytvsV1xxxxxx

The token owner is using Discord while I try.

@xCancazedd
Copy link

Why do i see multiple tokens with tokenlogger but none of them work?
E.G:
tokens:

NTYyMTUwNDE3ODU3OTA0NjQw.YMkWtA.ftgx-dZaant5VSPwIb5XbGxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YNiGLA.CoAq0MsT-KXwC2meQZpXY1xxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YMnnUg.ZVXamHym6v6BzaQzYy61Npxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YOsMOw.KZl7o_QlwYxl6nezWAIKXxxxxxx
NTYyMTUwNDE3ODU3OTA0NjQw.YOsKGg.2PYqRFeWV9zJApIytvsV1xxxxxx

The token owner is using Discord while I try.

what??

@Valium007
Copy link

Use mine

https://gist.github.com/monugeeky123/e1a21c91c9d4f1670596ddd52f66ffd3

Only one line of code, you dont need to put token, it will create a prompt and you just need to enter the token, no need to open developer console or anything like that, just save this text as a bookmark

You need to follow these steps for one time
Steps==>

  1. Create a bookmark and set name as you want and paste the code on URL field
  2. Go to discord.com/login
  3. Now enter on the search bar the bookmark you saved
  4. Go to the bookmark
  5. You will be asked a token
  6. Enter the token
  7. Page will refreshed
  8. You will be logged in

After following the steps, all you need to do is to go to discord.com/login, search the bookmark, click on it, enter the token, you will be logged in thats it

If you need any help, feel free to open an issue
its working on almost every browser and on Mobile phones also

@WaterZ-dev
Copy link

epic. very simple actually. I thought that to do this in js would be very hard, but i guess I was wrong. Thanks!

@Hana-Programming
Copy link

Nice worked like a charm

@33CJ33CJ33
Copy link

How do I get the token?

@33CJ33CJ33
Copy link

I decoded the user ID of an abusive user to get in their account but it only gives half the token. How do I get the other half??

@NotGAKi
Copy link

NotGAKi commented Apr 26, 2022

after putting the token and pressing ok. it loads then comes back to the login page.. i opened ispect and it shows this: (Pasting anything in here could give attackers access to your Discord account.) is there any new way to log in?

@IceWaltz
Copy link

IceWaltz commented Apr 26, 2022

after putting the token and pressing ok. it loads then comes back to the login page.. i opened ispect and it shows this: (Pasting anything in here could give attackers access to your Discord account.) is there any new way to log in?

You're looking at it, just get the tampermonkey extension and copy this code in and follow the instructions to use it, if it doesn't work try a different token, else it's probably an expired token

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