2025-09-09 14:37:32 +05:30
|
|
|
import { StackHandler } from "@stackframe/stack";
|
|
|
|
|
|
2026-02-20 18:21:24 +05:30
|
|
|
import { getAuthProvider } from "@/lib/auth/config";
|
2025-09-09 14:37:32 +05:30
|
|
|
|
2026-03-16 15:04:08 +05:30
|
|
|
import { BackButton } from "./BackButton";
|
|
|
|
|
|
2026-02-20 18:21:24 +05:30
|
|
|
export default async function Handler(props: unknown) {
|
|
|
|
|
const authProvider = await getAuthProvider();
|
2025-09-09 14:37:32 +05:30
|
|
|
|
|
|
|
|
if (authProvider === "local") {
|
|
|
|
|
return (
|
|
|
|
|
<div style={{ padding: '20px', textAlign: 'center' }}>
|
|
|
|
|
<h1>Local Auth Mode</h1>
|
|
|
|
|
<p>Stack Auth handler is disabled when using local authentication.</p>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-02-20 18:21:24 +05:30
|
|
|
|
|
|
|
|
// Lazily import the real StackServerApp only when needed
|
|
|
|
|
const { getStackServerApp } = await import("@/lib/auth/server");
|
|
|
|
|
const app = await getStackServerApp();
|
|
|
|
|
|
2026-03-16 15:04:08 +05:30
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col h-screen">
|
|
|
|
|
<BackButton />
|
|
|
|
|
<div className="flex-1 overflow-auto">
|
|
|
|
|
<StackHandler
|
|
|
|
|
fullPage
|
|
|
|
|
app={app!}
|
|
|
|
|
routeProps={props}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2025-09-09 14:37:32 +05:30
|
|
|
}
|