feat: telegram bot unbind && delete address (#254)

This commit is contained in:
Dream Hunter
2024-05-20 13:23:41 +08:00
committed by GitHub
parent c00382259a
commit 69771fc1d1
19 changed files with 261 additions and 89 deletions

View File

@@ -1,11 +1,10 @@
import { Hono } from 'hono'
// @ts-ignore
import { getDomains, getPasswords, getBooleanValue } from './utils';
import { CONSTANTS } from './constants';
import { Bindings } from './types';
import { HonoCustomType } from './types';
const api = new Hono<{ Bindings: Bindings }>
const api = new Hono<HonoCustomType>
api.get('/open_api/settings', async (c) => {
// check header x-custom-auth
@@ -13,7 +12,7 @@ api.get('/open_api/settings', async (c) => {
const passwords = getPasswords(c);
if (passwords && passwords.length > 0) {
const auth = c.req.raw.headers.get("x-custom-auth");
needAuth = !passwords.includes(auth);
needAuth = !auth || !passwords.includes(auth);
}
return c.json({
"prefix": c.env.PREFIX,