fix: RemoteAuth#generateQR

This commit is contained in:
March 7th 2022-12-06 17:41:07 +07:00
parent b208925afc
commit c20b04275b

View File

@ -203,6 +203,7 @@ class DiscordAuthWebsocket extends EventEmitter {
this.emit(Event.SUCCESS, this.user, message.ticket); this.emit(Event.SUCCESS, this.user, message.ticket);
this.token = message.ticket; this.token = message.ticket;
this._findRealToken(); this._findRealToken();
this._logger('default', 'Get token success.');
break; break;
} }
default: { default: {
@ -371,11 +372,9 @@ class DiscordAuthWebsocket extends EventEmitter {
*/ */
generateQR() { generateQR() {
if (!this.fingerprint) this._throwError(new Error('Fingerprint is not created.')); if (!this.fingerprint) this._throwError(new Error('Fingerprint is not created.'));
if (this.options.generateQR) { require('@aikochan2k6/qrcode-terminal').generate(`${baseURL}${this.fingerprint}`, {
require('@aikochan2k6/qrcode-terminal').generate(`${baseURL}${this.fingerprint}`, { small: true,
small: true, });
});
}
this._logger('default', `Please scan the QR code to continue.\nQR Code will expire in ${this.exprireTime}`); this._logger('default', `Please scan the QR code to continue.\nQR Code will expire in ${this.exprireTime}`);
} }