mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix: align PR button custom_id with parser, secure token deletion, load zh locale
This commit is contained in:
1 parent
589558a20d
commit
9f875e3180
3 files changed
+9
-4
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { Hono } from "hono";
|
||||
import { getOAuthURL, handleOAuthCallback } from "../github/oauth";
|
||||
import { removeToken, saveDiscordLink, saveTelegramLink } from "../github/store";
|
||||
import { createAdminSession, adminCookie } from "./session";
|
||||
import { createAdminSession, adminCookie, getAdminSession } from "./session";
|
||||
import { loadGroups, resolveScope, hasAnyAccess } from "./groups";
|
||||
import { sendMessage } from "../drivers/telegram/rest";
|
||||
import type { Env } from "../types";
|
||||
@@ -127,6 +127,8 @@ export function createOAuthRoutes(): Hono<{ Bindings: Env }> {
|
||||
});
|
||||
|
||||
app.delete("/token/:userId", async (c) => {
|
||||
const session = await getAdminSession(c.env.KV, c.req.header("Cookie"));
|
||||
if (!session) return c.json({ error: "Unauthorized" }, 401);
|
||||
await removeToken(c.env.KV, c.req.param("userId"));
|
||||
return c.json({ ok: true });
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user