fix: elysia issues 2
This commit is contained in:
@@ -6,7 +6,10 @@ import { createRateLimiter } from "../utils/rate-limit";
|
||||
const EMAIL_HMAC_KEY = process.env.EMAIL_HMAC_KEY || "pingql-default-hmac-key";
|
||||
|
||||
function redir(to: string) {
|
||||
return new Response(null, { status: 302, headers: { Location: to } });
|
||||
return new Response(
|
||||
`<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;url=${to}"><meta name="robots" content="noindex"></head><body></body></html>`,
|
||||
{ headers: { "content-type": "text/html; charset=utf-8", "cache-control": "no-store" } },
|
||||
);
|
||||
}
|
||||
|
||||
// ── Per-IP rate limiting for auth endpoints ───────────────────────────
|
||||
|
||||
@@ -111,7 +111,10 @@ export function html(template: string, data: Record<string, unknown> = {}) {
|
||||
}
|
||||
|
||||
function redirect(to: string) {
|
||||
return new Response(null, { status: 302, headers: { Location: to } });
|
||||
return new Response(
|
||||
`<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;url=${to}"><meta name="robots" content="noindex"></head><body></body></html>`,
|
||||
{ headers: { "content-type": "text/html; charset=utf-8", "cache-control": "no-store" } },
|
||||
);
|
||||
}
|
||||
|
||||
async function getAccountId(cookie: any, headers: any): Promise<{ accountId: string; keyId: string | null; plan: string } | null> {
|
||||
|
||||
Reference in New Issue
Block a user