fix: elysia issues 2

This commit is contained in:
2026-03-19 10:06:14 +04:00
parent 03fe13e707
commit d8d1952304
3 changed files with 10 additions and 5 deletions
+4 -1
View File
@@ -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 ───────────────────────────
+4 -1
View File
@@ -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> {