aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/app/(auth)/layout.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/(auth)/layout.tsx')
-rw-r--r--frontend/src/app/(auth)/layout.tsx36
1 files changed, 36 insertions, 0 deletions
diff --git a/frontend/src/app/(auth)/layout.tsx b/frontend/src/app/(auth)/layout.tsx
new file mode 100644
index 0000000..9651b4b
--- /dev/null
+++ b/frontend/src/app/(auth)/layout.tsx
@@ -0,0 +1,36 @@
+'use client';
+
+import { useEffect } from 'react';
+import { useRouter } from 'next/navigation';
+
+export default function AuthLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ const router = useRouter();
+
+ useEffect(() => {
+ // If already logged in, redirect to dashboard
+ const token = localStorage.getItem('token');
+ if (token) {
+ router.push('/dashboard');
+ }
+ }, [router]);
+
+ return (
+ <div className="flex min-h-screen flex-col items-center justify-center bg-muted/40">
+ <div className="w-full max-w-md rounded-lg border bg-card p-6 shadow-sm">
+ <div className="flex flex-col space-y-2 text-center mb-6">
+ <h1 className="text-2xl font-semibold tracking-tight">
+ Finance Management
+ </h1>
+ <p className="text-sm text-muted-foreground">
+ Manage your personal finances
+ </p>
+ </div>
+ {children}
+ </div>
+ </div>
+ );
+} \ No newline at end of file