From c5d1b8d93a52e4461072e2cf8b5624091d671e03 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Wed, 12 Jul 2023 01:14:38 +0700 Subject: [PATCH] fix: remote auth --- src/util/RemoteAuth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/RemoteAuth.js b/src/util/RemoteAuth.js index ff89ec1..5d6ca5f 100644 --- a/src/util/RemoteAuth.js +++ b/src/util/RemoteAuth.js @@ -460,7 +460,7 @@ new DiscordAuthWebsocket({ ).json(); if (res?.captcha_key) { this.captchaCache = res; - } else { + } else if (!res.encrypted_token) { this._throwError(new Error('Request failed. Please try again.', res)); this.captchaCache = null; } @@ -470,7 +470,7 @@ new DiscordAuthWebsocket({ const token = await this.options.captchaSolver(this.captchaCache); return this._findRealToken(token); } - this.realToken = this._decryptPayload(res.data.encrypted_token).toString(); + this.realToken = this._decryptPayload(res.encrypted_token).toString(); /** * Emitted whenever a real token is found. * @event DiscordAuthWebsocket#finish