fix: add MFA code support to authorizeURL method
This commit is contained in:
@@ -99,10 +99,15 @@ class APIRequest {
|
||||
'base64',
|
||||
);
|
||||
}
|
||||
|
||||
if (this.options.mfaToken) {
|
||||
headers['X-Discord-Mfa-Authorization'] = this.options.mfaToken;
|
||||
}
|
||||
|
||||
// Captcha
|
||||
if (captchaKey && typeof captchaKey == 'string') headers['X-Captcha-Key'] = captchaKey;
|
||||
if (captchaRqToken && typeof captchaRqToken == 'string') headers['X-Captcha-Rqtoken'] = captchaRqToken;
|
||||
|
||||
let body;
|
||||
if (this.options.files?.length) {
|
||||
body = new FormData();
|
||||
@@ -128,10 +133,6 @@ class APIRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// Captcha
|
||||
if (captchaKey && typeof captchaKey == 'string') headers['X-Captcha-Key'] = captchaKey;
|
||||
if (captchaRqToken && typeof captchaRqToken == 'string') headers['X-Captcha-Rqtoken'] = captchaRqToken;
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
|
||||
return fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user