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:
Loma Bot Ops
2026-11-22 16:48:42 +07:00
parent 9d5a029fa5
commit 4a673ebb28
38 changed files with 130 additions and 57 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
"use client";
import { withBase } from "@/lib/base-path";
import { useState } from "react";
import { useRouter, useSearchParams } from "next/navigation";
@@ -75,7 +76,7 @@ export function LoginForm({ providers }: { providers: Provider[] }) {
e.preventDefault();
setBusy(true);
setError(null);
const res = await fetch("/api/auth/login", {
const res = await fetch(withBase("/api/auth/login"), {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email, password, remember }),
@@ -92,7 +93,7 @@ export function LoginForm({ providers }: { providers: Provider[] }) {
function socialHref(p: Provider): string {
const q = new URLSearchParams({ from, remember: remember ? "1" : "0" });
return `/api/auth/oauth/${p}/start?${q}`;
return withBase(`/api/auth/oauth/${p}/start?${q}`);
}
return (