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:
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { withBase } from "@/lib/base-path";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
@@ -127,7 +128,7 @@ export function Shell({
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await fetch("/api/auth/logout", { method: "POST" });
|
||||
await fetch(withBase("/api/auth/logout"), { method: "POST" });
|
||||
router.replace("/login");
|
||||
router.refresh();
|
||||
}
|
||||
@@ -162,7 +163,7 @@ export function Shell({
|
||||
<div className="flex items-center gap-3 px-1.5 pb-2">
|
||||
<span className="w-9 h-9 rounded-[10px] overflow-hidden shrink-0 shadow-sm">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- generated app icon route */}
|
||||
<img src="/icons/192" alt="" width={36} height={36} />
|
||||
<img src={withBase("/icons/192")} alt="" width={36} height={36} />
|
||||
</span>
|
||||
<div className="leading-tight flex-1 min-w-0">
|
||||
<div className="font-bold">ระบบจัดการเพจ</div>
|
||||
|
||||
Reference in New Issue
Block a user