mirror of
https://github.com/Tony0410/quietthanks.git
synced 2026-05-24 21:31:41 +08:00
- Add users and sessions tables to database schema - Add bcryptjs for password hashing - Create auth API routes (login, register, logout, me) - Add AuthProvider context for client-side auth state - Update all API routes to require authentication and filter by userId - Create login and register pages - Add AppShell component for authenticated layout - Update all pages to use AppShell and show user info - Each user now has their own private entries and tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
381 B
TypeScript
20 lines
381 B
TypeScript
"use client";
|
|
|
|
import { useAuth } from "./AuthProvider";
|
|
import { Navigation } from "./Navigation";
|
|
|
|
export function AppShell({ children }: { children: React.ReactNode }) {
|
|
const { user } = useAuth();
|
|
|
|
if (!user) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<main className="max-w-lg mx-auto px-4 py-6 pb-24">{children}</main>
|
|
<Navigation />
|
|
</>
|
|
);
|
|
}
|