Support sub-path deploy via NEXT_PUBLIC_BASE_PATH (loma.chat/pagiva)
Adds basePath config, withBase/appUrl helpers, base-path-aware cookies, OAuth redirects, manifest, service worker and cron runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
import { withBase } from "@/lib/base-path";
|
||||
import { NextResponse } from "next/server";
|
||||
import { safeFacebookErrorMessage, UserFacingError, FacebookApiError } from "@/lib/facebook/client";
|
||||
|
||||
@@ -23,7 +24,7 @@ export function errorResponse(e: unknown, context: string): NextResponse {
|
||||
* this page is same-site. `path` must already be a validated same-origin path.
|
||||
*/
|
||||
export function htmlRedirect(path: string): Response {
|
||||
const safe = path.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
||||
const safe = withBase(path).replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
||||
const html = `<!doctype html><meta charset="utf-8"><meta http-equiv="refresh" content="0;url=${safe}"><title>กำลังกลับสู่ระบบ…</title><p style="font-family:system-ui;padding:24px">กำลังกลับสู่ระบบ… <a href="${safe}">ไปต่อ</a></p>`;
|
||||
return new Response(html, { headers: { "content-type": "text/html; charset=utf-8", "cache-control": "no-store" } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user