Add token check exception for localhost servers
Updated the network form modal to allow missing tokens only for servers with host '127.0.0.1'. This enhances security by prompting a warning when a token is missing for non-localhost servers.
This commit is contained in:
1 parent
dc858807ae
commit
eda1e5f2ed
1 file changed
+1
-1
@@ -55,7 +55,7 @@ const NetworkFormModal = <T extends keyof OneBotConfig['network']> (
|
|||||||
|
|
||||||
if (['httpServers', 'httpSseServers', 'websocketServers'].includes(field)) {
|
if (['httpServers', 'httpSseServers', 'websocketServers'].includes(field)) {
|
||||||
const serverData = data as any;
|
const serverData = data as any;
|
||||||
if (!serverData.token) {
|
if (!serverData.token && serverData.host !== '127.0.0.1') {
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
dialog.confirm({
|
dialog.confirm({
|
||||||
title: '安全警告',
|
title: '安全警告',
|
||||||
|
|||||||
Reference in new issue
Block a user