feat(all): Token retrieve optimized.

This commit is contained in:
rodrigorodriguez 2022-12-23 08:23:08 -03:00
parent 5fbaaddbcb
commit 6eb9d6cbf4

View file

@ -52,6 +52,7 @@ import Path from 'path';
import PasswordGenerator from 'strict-password-generator'; import PasswordGenerator from 'strict-password-generator';
import crypto from 'crypto'; import crypto from 'crypto';
import Fs from 'fs'; import Fs from 'fs';
import { GBServer } from '../../../src/app.js';
/** /**
* Services for server administration. * Services for server administration.
@ -247,10 +248,8 @@ export class GBAdminService implements IGBAdminService {
} }
public async acquireElevatedToken (instanceId: number): Promise<string> { public async acquireElevatedToken (instanceId: number): Promise<string> {
// TODO: Use boot bot as base for authentication. const minBoot = GBServer.globals.minBoot as any;
instanceId = minBoot.instanceId;
const botId = GBConfigService.get('BOT_ID');
instanceId = (await this.core.loadInstanceByBotId(botId)).instanceId;
return new Promise<string>(async (resolve, reject) => { return new Promise<string>(async (resolve, reject) => {
const instance = await this.core.loadInstanceById(instanceId); const instance = await this.core.loadInstanceById(instanceId);