feat(api): user-scoped activities CRUD with shared auth helper

This commit is contained in:
Bas van Rossem
2026-06-17 15:34:42 +02:00
parent 57809985fd
commit 5e61b7720d
4 changed files with 286 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import type { Context } from 'hono';
import { auth } from '../auth';
export async function getSessionUser(c: Context): Promise<{ id: string } | null> {
const session = await auth.api.getSession({ headers: c.req.raw.headers });
if (!session) return null;
return { id: session.user.id };
}