dograh/ui/src/app/handler/[...stack]/page.tsx

36 lines
923 B
TypeScript
Raw Normal View History

2025-09-09 14:37:32 +05:30
import { StackHandler } from "@stackframe/stack";
import { getAuthProvider } from "@/lib/auth/config";
2025-09-09 14:37:32 +05:30
import { BackButton } from "./BackButton";
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>
);
}
// Lazily import the real StackServerApp only when needed
const { getStackServerApp } = await import("@/lib/auth/server");
const app = await getStackServerApp();
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
}