Add src/lib/auth.ts helper for extracting user from Auth.js session
Implement task 5.2: Create getAuthUser() helper that calls auth() from src/auth.ts and returns the authenticated user object or null if not authenticated. Mark task 5.2 complete in tasks.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
55fd91ff52
commit
d4e92cf88f
2 changed files with 7 additions and 1 deletions
6
src/lib/auth.ts
Normal file
6
src/lib/auth.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { auth } from "@/auth";
|
||||
|
||||
export async function getAuthUser() {
|
||||
const session = await auth();
|
||||
return session?.user ?? null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue