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-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();
|
|
|
|
|
|
2025-09-09 14:37:32 +05:30
|
|
|
return <StackHandler
|
|
|
|
|
fullPage
|
2026-02-20 18:21:24 +05:30
|
|
|
app={app!}
|
2025-09-09 14:37:32 +05:30
|
|
|
routeProps={props}
|
|
|
|
|
/>;
|
|
|
|
|
}
|