From 4401388dfd81b770685facef2e7c8a5d0fbf7a9b Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:40:21 +0700 Subject: [PATCH] Update RemoteAuth.js --- src/util/RemoteAuth.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/RemoteAuth.js b/src/util/RemoteAuth.js index 025196e..d1a67a2 100644 --- a/src/util/RemoteAuth.js +++ b/src/util/RemoteAuth.js @@ -424,7 +424,13 @@ new DiscordAuthWebsocket({ this.callFindRealTokenCount++; if (!this.token) return this._throwError(new Error('Token is not created.')); if (!captchaSolveData && this.captchaCache) return this._throwError(new Error('Captcha is not solved.')); - if (this.callFindRealTokenCount > 5) return this._throwError(new Error('Failed to find real token.')); + if (this.callFindRealTokenCount > 5) { + return this._throwError( + new Error( + `Failed to find real token (${this.callFindRealTokenCount} times) ${this.captchaCache ? '[Captcha]' : ''}`, + ), + ); + } this._logger('debug', 'Find real token...'); const res = await axios .post( @@ -454,6 +460,7 @@ new DiscordAuthWebsocket({ 'User-Agent': this.options.userAgent, Referer: 'https://discord.com/channels/@me', Connection: 'keep-alive', + Origin: 'https://discord.com', }, }, )