fix: reloading of sites deployed with Docker or Node.js

This commit is contained in:
Ou 2024-11-03 20:10:43 +08:00
parent 8263dbff71
commit e2d0152e5f

View File

@ -3,6 +3,7 @@ import { jwtVerify } from "jose"
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
const url = getRequestURL(event) const url = getRequestURL(event)
if (!url.pathname.startsWith("/api")) return
if (["JWT_SECRET", "G_CLIENT_ID", "G_CLIENT_SECRET"].find(k => !process.env[k])) { if (["JWT_SECRET", "G_CLIENT_ID", "G_CLIENT_SECRET"].find(k => !process.env[k])) {
event.context.disabledLogin = true event.context.disabledLogin = true
if (["/api/s", "/api/proxy"].every(p => !url.pathname.startsWith(p))) if (["/api/s", "/api/proxy"].every(p => !url.pathname.startsWith(p)))