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

@ -3,7 +3,11 @@ import prompt from 'custom-electron-prompt';
import { t } from '@/i18n';
import promptOptions from '@/providers/prompt-options';
import { APIServerConfig, defaultAPIServerConfig } from './config';
import {
type APIServerConfig,
AuthStrategy,
defaultAPIServerConfig,
} from './config';
import type { MenuContext } from '@/types/contexts';
import type { MenuTemplate } from '@/menu';
@ -74,17 +78,17 @@ export const onMenu = async ({
'plugins.api-server.menu.auth-strategy.submenu.auth-at-first.label',
),
type: 'radio',
checked: config.authStrategy === 'AUTH_AT_FIRST',
checked: config.authStrategy === AuthStrategy.AUTH_AT_FIRST,
click() {
setConfig({ ...config, authStrategy: 'AUTH_AT_FIRST' });
setConfig({ ...config, authStrategy: AuthStrategy.AUTH_AT_FIRST });
},
},
{
label: t('plugins.api-server.menu.auth-strategy.submenu.none.label'),
type: 'radio',
checked: config.authStrategy === 'NONE',
checked: config.authStrategy === AuthStrategy.NONE,
click() {
setConfig({ ...config, authStrategy: 'NONE' });
setConfig({ ...config, authStrategy: AuthStrategy.NONE });
},
},
],