mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-08-05 05:17:14 +08:00
fix: UI tab active icon wrong position (#416)
This commit is contained in:
@@ -2,16 +2,9 @@ import { Context } from "hono";
|
||||
import { HonoCustomType } from "../types";
|
||||
import { CONSTANTS } from "../constants";
|
||||
import { WebhookSettings } from "../models";
|
||||
import { getBooleanValue } from "../utils";
|
||||
import { commonParseMail, sendWebhook } from "../common";
|
||||
|
||||
async function getWebhookSettings(c: Context<HonoCustomType>): Promise<Response> {
|
||||
if (!c.env.KV) {
|
||||
return c.text("KV is not available", 400);
|
||||
}
|
||||
if (!getBooleanValue(c.env.ENABLE_WEBHOOK)) {
|
||||
return c.text("Webhook is disabled", 403);
|
||||
}
|
||||
const settings = await c.env.KV.get<WebhookSettings>(
|
||||
CONSTANTS.WEBHOOK_KV_ADMIN_MAIL_SETTINGS_KEY, "json"
|
||||
) || new WebhookSettings();
|
||||
|
||||
@@ -7,12 +7,6 @@ import { commonParseMail, sendWebhook } from "../common";
|
||||
|
||||
|
||||
async function getWebhookSettings(c: Context<HonoCustomType>): Promise<Response> {
|
||||
if (!c.env.KV) {
|
||||
return c.text("KV is not available", 400);
|
||||
}
|
||||
if (!getBooleanValue(c.env.ENABLE_WEBHOOK)) {
|
||||
return c.text("Webhook is disabled", 403);
|
||||
}
|
||||
const { address } = c.get("jwtPayload")
|
||||
const adminSettings = await c.env.KV.get<AdminWebhookSettings>(CONSTANTS.WEBHOOK_KV_SETTINGS_KEY, "json");
|
||||
if (!adminSettings?.allowList.includes(address)) {
|
||||
|
||||
@@ -42,9 +42,11 @@ app.use('/*', async (c, next) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// webhook check
|
||||
if (
|
||||
c.req.path.startsWith("/api/webhook")
|
||||
|| c.req.path.startsWith("/admin/webhook")
|
||||
|| c.req.path.startsWith("/admin/mail_webhook")
|
||||
) {
|
||||
if (!c.env.KV) {
|
||||
return c.text("KV is not available", 400);
|
||||
|
||||
Reference in New Issue
Block a user