feat(all): Token retrieve optimized.
This commit is contained in:
parent
5fbaaddbcb
commit
6eb9d6cbf4
1 changed files with 3 additions and 4 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue