Skip to content

Instantly share code, notes, and snippets.

@m-Phoenix852
Created August 26, 2020 07:45
Show Gist options
  • Save m-Phoenix852/b47fffb0fd579bc210420cedbda30b61 to your computer and use it in GitHub Desktop.
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);
@RealHeha
Copy link

RealHeha commented Mar 11, 2023

just go to inspect > applications > local storage > discord.com, then click mobile icon on top right of inspect and search "token" in the filter then change the value to your token

@TruongDinhDTri
Copy link

TruongDinhDTri commented Mar 11, 2023 via email

@TruongDinhDTri
Copy link

please i need your help add me on discord Wiwi#0402 it’s super urgent please

It doesn't work anymore guys. I check the dev tools an saw that each time you paste the token in and refresh instead of it log you in it redirect you back to the login page. Each time you refresh even if you paste the token in the "local storage" but if you refresh it will automatically run another thing it's
+-----------------+---------------------------------+
| tokens | {"user_id_cache": "your token"} |
+-----------------+---------------------------------+
| user_id_cache: | "your_user_id" |
-------------------+---------------------------------+
| token | "your_token" |
+-----------------+---------------------------------+
But even i paste these two value in, each time you reload it just empty the token --> refresher -->
token: {} --> back to the login page

Added

@DracoGamer2
Copy link

It work

@DracoGamer2
Copy link

It works depance the pc you have, i have a cromebook and it works

@DracoGamer2
Copy link

DracoGamer2 commented Mar 23, 2023 via email

@DracoGamer2
Copy link

DracoGamer2 commented Mar 23, 2023 via email

@DracoGamer2
Copy link

DracoGamer2 commented Mar 23, 2023 via email

@Sheepasus
Copy link

Can anyone explain me how to get it work as well?

@DracoGamer2
Copy link

DracoGamer2 commented Mar 29, 2023 via email

@Sheepasus
Copy link

yeah I already got it to work, I even made it work for tokens that are 2fa verified aswell, As they require a different approach

@PrmWiny
Copy link

PrmWiny commented Mar 30, 2023

I things it work sometime

before the QR CODE LOGIN IS REFRESHING add some console command in it and wait around 120 sec for the QR CODE refreshing

boom! it's works!!!!

but not 100% work all the times i think u can do a trick in command for get it for 100% work.

image

I use this command : 👍

let token = "ur token";

function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement iframe).contentWindow.localStorage.token = "${token}"
}, 50);
}

login(token);

@Sheepasus
Copy link

the problem is the waiting period, you need to set it to 100 instead of 50, and then for me it works 99% of the time

@Sheepasus
Copy link

yeah I already got it to work, I even made it work for tokens that are 2fa verified aswell, As they require a different approach

What are you talking about 2fa it doesn't matter 2fa or not you just get in with token? Can u explain

so this code did not work for me on my alt, 2fa tokens are 70 characters whereas phone verified are like 59 characters or something, so to make it work for tokens that have 2fa verification set up, I had to use a different method. So now I use this method for 59 characters and my own method for 2fa verified tokens

@JacksonCJG
Copy link

Could someone help me with this my discords !Jackson!#5719

@opay1
Copy link

opay1 commented Apr 8, 2023

could someone help me ? my discord opay432#7032

@JakeRuCodes
Copy link

Not sure if this'll work but try this :

(function() {
let token = "YOUR_DISCORD_TOKEN";
let ws = new WebSocket("wss://gateway.discord.gg/?v=6&encoding=json");

ws.onopen = function() {
ws.send(
JSON.stringify({
op: 2,
d: {
token: token,
properties: {
$os: "Windows",
$browser: "Chrome",
$device: "Desktop",
},
},
})
);
};

ws.onmessage = function(event) {
let data = JSON.parse(event.data);
if (data.op === 10) {
let interval = data.d.heartbeat_interval;
setInterval(function() {
ws.send(JSON.stringify({ op: 1, d: null }));
}, interval);
}
};
})();

@RandomPerson54163
Copy link

None of these methods work. Can anyone pls find a solution to this.

@pxldevv
Copy link

pxldevv commented Jun 20, 2023

This code works, just spam it in console and it works. Also use a working token

@JeiLys
Copy link

JeiLys commented Aug 4, 2023

please i need your help add me on discord Wiwi#0402 it’s super urgent please

It doesn't work anymore guys. I check the dev tools an saw that each time you paste the token in and refresh instead of it log you in it redirect you back to the login page. Each time you refresh even if you paste the token in the "local storage" but if you refresh it will automatically run another thing it's
+-----------------+---------------------------------+
| tokens | {"user_id_cache": "your token"} |
+-----------------+---------------------------------+
| user_id_cache: | "your_user_id" |
-------------------+---------------------------------+
| token | "your_token" |
+-----------------+---------------------------------+
But even i paste these two value in, each time you reload it just empty the token --> refresher -->
token: {} --> back to the login page

Added

Can you add me on discord for help me pls ? JeiLys.

@pxldevv
Copy link

pxldevv commented Aug 5, 2023

please i need your help add me on discord Wiwi#0402 it’s super urgent please

It doesn't work anymore guys. I check the dev tools an saw that each time you paste the token in and refresh instead of it log you in it redirect you back to the login page. Each time you refresh even if you paste the token in the "local storage" but if you refresh it will automatically run another thing it's
+-----------------+---------------------------------+
| tokens | {"user_id_cache": "your token"} |
+-----------------+---------------------------------+
| user_id_cache: | "your_user_id" |
-------------------+---------------------------------+
| token | "your_token" |
+-----------------+---------------------------------+
But even i paste these two value in, each time you reload it just empty the token --> refresher -->
token: {} --> back to the login page

Added

Can you add me on discord for help me pls ? JeiLys.

I sent an invite

@mahonmc
Copy link

mahonmc commented Aug 14, 2023

does anyone know how to do it 2023 august i cant find any working tutorials and ima ure my token is positive.

@BBSFire
Copy link

BBSFire commented Aug 16, 2023

hello I would need help I lost my discord account and the A2F is connected to it despite the fact that I have sent several times emails to discore they do not want to help me recover it could help me please please

@Weredime
Copy link

Weredime commented Sep 23, 2023

document.body.appendChild(document.createElement("iframe")).contentWindow.localStorage.setItem("token", "\"token.here\"");
setTimeout(() => location.reload(), 1000);

should work :D

@wolfy402
Copy link

could I get some help pls?

@m8cx
Copy link

m8cx commented Oct 29, 2023

could I get some help pls?

do you suffer from the stupid @wolfy402

@KyloSoot
Copy link

need help. tried every single one and none works

@m8cx
Copy link

m8cx commented Nov 9, 2023

need help. tried every single one and none works

are you acoustic

@Heroscarman
Copy link

foes this still work? and what am i supposed to run it on?

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