import { StackHandler, StackTheme } from "@stackframe/stack";
import { AuthEnterpriseCTA } from "@/components/auth/AuthEnterpriseCTA";
import { AuthShell } from "@/components/auth/AuthShell";
import { getAuthProvider } from "@/lib/auth/config";
import { BackButton } from "./BackButton";
import { stackAuthDarkTheme } from "./stack-theme";
// Stack Auth serves every auth page from this one catch-all. We give the brand
// split-screen shell to the user-facing FORM routes and render only the wide /
// interstitial "machine" routes full-page (so account-settings etc. aren't
// cramped into the narrow auth card). This is a BLOCKLIST, not an allowlist, so
// new or aliased form routes — Stack's `log-in`/`register` aliases, case/dash
// variants, email-verification, mfa, team-invitation — get the shell by default.
// Matching is normalized (lowercase, dashes stripped) to mirror Stack's own
// case- and dash-insensitive route resolution.
const FULL_PAGE_ROUTES = new Set([
"accountsettings",
"oauthcallback",
"magiclinkcallback",
"signout",
"error",
]);
export default async function Handler(props: unknown) {
const authProvider = await getAuthProvider();
if (authProvider === "local") {
return (
Stack Auth handler is disabled when using local authentication.