summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/mfa.cpp13
-rw-r--r--protocols/Discord/src/proto.cpp2
2 files changed, 13 insertions, 2 deletions
diff --git a/protocols/Discord/src/mfa.cpp b/protocols/Discord/src/mfa.cpp
index 86b37fe63d..703b0c17dd 100644
--- a/protocols/Discord/src/mfa.cpp
+++ b/protocols/Discord/src/mfa.cpp
@@ -80,7 +80,18 @@ public:
JSONNode root;
root << CHAR_PARAM("ticket", m_szTicket) << WCHAR_PARAM("code", wszCode);
- auto *pReq = new AsyncHttpRequest(m_proto, REQUEST_POST, (m_mode == 1) ? "/auth/mfa/sms" : "/auth/mfa/totp", &CDiscordProto::OnSendTotp, &root);
+ const char *pszUrl;
+ switch (m_mode) {
+ case 0: pszUrl = "/auth/mfa/totp"; break;
+ case 1: pszUrl = "/auth/mfa/sms"; break;
+ case 2: pszUrl = "/auth/mfa/backup"; break;
+ default:
+ return false;
+ }
+
+ auto *pReq = new AsyncHttpRequest(m_proto, REQUEST_POST, pszUrl, &CDiscordProto::OnSendTotp, &root);
+ pReq->AddHeader("Origin", "https://discord.com");
+ pReq->AddHeader("Referer", "https://discord.com/login");
pReq->pUserInfo = this;
m_proto->Push(pReq);
return false;
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index 8ebdcf45fa..f1df2c2a12 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -63,7 +63,7 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) :
m_bSyncDeleteUsers(this, "DeleteServerUsers", true)
{
// Hidden setting!
- m_szApiUrl = getMStringA("ApiUrl", "https://discord.com/api/v10");
+ m_szApiUrl = getMStringA("ApiUrl", "https://discord.com/api/v9");
// Services
CreateProtoService(PS_GETAVATARINFO, &CDiscordProto::GetAvatarInfo);