fix(api-server): fix init/authentication error

- Close #2497
This commit is contained in:
JellyBrick
2024-10-14 17:51:59 +09:00
parent 6abcbee290
commit 534aeb163a
6 changed files with 38 additions and 25 deletions

View File

@ -1,8 +1,13 @@
export enum AuthStrategy {
AUTH_AT_FIRST = 'AUTH_AT_FIRST',
NONE = 'NONE',
}
export interface APIServerConfig {
enabled: boolean;
hostname: string;
port: number;
authStrategy: 'AUTH_AT_FIRST' | 'NONE';
authStrategy: AuthStrategy;
secret: string;
authorizedClients: string[];
@ -12,7 +17,7 @@ export const defaultAPIServerConfig: APIServerConfig = {
enabled: true,
hostname: '0.0.0.0',
port: 26538,
authStrategy: 'AUTH_AT_FIRST',
authStrategy: AuthStrategy.AUTH_AT_FIRST,
secret: Date.now().toString(36),
authorizedClients: [],