Replace Firebase auth with SuperTokens PreBuilt UI for seamless integration. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
858 B
TypeScript
33 lines
858 B
TypeScript
"use client";
|
|
|
|
import dynamic from "next/dynamic";
|
|
import { useEffect, useState } from "react";
|
|
|
|
// Dynamically import SuperTokens component (client-side only)
|
|
const SuperTokensAuthComponent = dynamic(
|
|
() => import("@/app/components/SuperTokensAuthComponent"),
|
|
{ ssr: false }
|
|
);
|
|
|
|
export default function AuthPage() {
|
|
const [mounted, setMounted] = useState(false);
|
|
|
|
useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
|
|
if (!mounted) {
|
|
return (
|
|
<div className="flex min-h-screen items-center justify-center bg-background">
|
|
<div className="text-center">
|
|
<div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent mx-auto mb-4" />
|
|
<p className="text-muted-foreground">Loading authentication...</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return <SuperTokensAuthComponent />;
|
|
}
|
|
|