import { prisma } from '@repo/db'; import type { SessionUser } from '@repo/api'; // v0.1 admin-web auth: AUTH_DEV_AUTOLOGIN=true → always admin@demo.local. // No session/cookie mechanism needed for the demo phase. export async function resolveUser(): Promise { if (process.env['AUTH_DEV_AUTOLOGIN'] !== 'true') return null; const admin = await prisma.user.findFirst({ where: { email: 'admin@demo.local' } }); if (!admin) return null; return { id: admin.id, email: admin.email, role: admin.role as 'ADMIN', tenantId: admin.tenantId, }; }