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 { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -17,7 +18,7 @@ export default function ChangePasswordPage() {
|
||||
if (newPassword !== confirm) return setError("รหัสผ่านใหม่ทั้งสองช่องไม่ตรงกัน");
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
const res = await fetch("/api/auth/change-password", {
|
||||
const res = await fetch(withBase("/api/auth/change-password"), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ currentPassword, newPassword }),
|
||||
@@ -30,7 +31,7 @@ export default function ChangePasswordPage() {
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await fetch("/api/auth/logout", { method: "POST" });
|
||||
await fetch(withBase("/api/auth/logout"), { method: "POST" });
|
||||
router.replace("/login");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user