qeled / discordie

Predictable JavaScript abstractions for Discord API.
https://qeled.github.io/discordie/
BSD 2-Clause "Simplified" License
190 stars 45 forks source link

How does the rest.auth work? #118

Closed JacobTDC closed 2 years ago

JacobTDC commented 6 years ago

I tried to use this library as a way to figure out how to login, but when I use

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
  if (this.readyState == 4) {
    alert(this.responseText);
  }
};
xhttp.open("POST", "https://discordapp.com/api/auth/login", true);
xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.send(JSON.stringify(auth));

it returns {"captcha_key": ["captcha-required"]}. What captcha? There is nothing in the Discordie code about this captcha. How does it login?

Edsardio commented 6 years ago

This has nothing to do with the library. I suggest you look into passport

JacobTDC commented 6 years ago

Okay. Most certainly will. Sorry about posting here, @Edsardio, I just had nowhere else to find the needed information, no matter where I looked. This library is the only code I could find that successfully logs in to Discord using an email and password.

ghost commented 6 years ago

@JacobTDC Using non-documentated endpoints (such as /auth/login) is strictly forbidden. Userbots are aswell forbidden and results in a platform ban. If you want to make a "Login with Discord" thing, use OAuth 2.0.

JacobTDC commented 6 years ago

I'm a developer, and I need full account access. To test a protocol.

ghost commented 6 years ago

"I'm a developer" is no excuse for anything. If you need access to the account, use RPC (which requires your app to get whitelisted). Otherwise you risk your account.

JacobTDC commented 6 years ago

It's also only bannnable if you use 2-Factor-Auth, @CharlotteDunois.

JacobTDC commented 6 years ago

I meant to put that in the previous message, but I accidentally sent it, and you can't edit on mobile.

JacobTDC commented 6 years ago

At least, that's what I read, @CharlotteDunois. Please correct me if I'm wrong.

ghost commented 6 years ago

grafik Both are bannable.

JacobTDC commented 6 years ago

Oh, I don't plan on automating it, I am just doing it for the sake of learning.

JacobTDC commented 6 years ago

Well, that was stated wrong. I meant, I'm trying to make a webpage that allows sending of embeds from users.

JacobTDC commented 6 years ago

Sorry for any confusion, I'm just having trouble forming sentences from thoughts right now.

ghost commented 6 years ago

Use a webhook.

JacobTDC commented 6 years ago

That's... Actually a good solution... Thanks @CharlotteDunois... I hadn't thought of that...