implement better-auth auth with postgres and route protection

This commit is contained in:
2026-02-24 13:32:43 -05:00
parent fd168f607c
commit 52a4ab38d3
31 changed files with 1202 additions and 89 deletions

View File

@@ -1,10 +1,17 @@
import { requireAuthenticatedSession } from '@/lib/server/auth-session';
export async function GET() {
const { session, response } = await requireAuthenticatedSession();
if (response) {
return response;
}
return Response.json({
user: {
id: 1,
email: 'operator@local.fiscal',
name: 'Local Operator',
image: null
id: session.user.id,
email: session.user.email,
name: session.user.name,
image: session.user.image
}
});
}