import { redirect } from 'next/navigation'; import { getTranslations } from 'next-intl/server'; import { prisma } from '@repo/db'; import { resolveUser } from '@/lib/auth'; import { OperatorPicker } from './operator-picker'; // This page intentionally fetches operators without a session: the picker IS // the login step. prisma is used directly (bypassing the tRPC auth layer) so // the page works even when AUTH_DEV_AUTOLOGIN=false. export default async function SelectOperatorPage() { const t = await getTranslations('auth'); const user = await resolveUser(); if (user) redirect('/'); const operators = await prisma.user.findMany({ where: { role: 'OPERATOR' }, select: { id: true, email: true }, orderBy: { email: 'asc' }, }); return (

{t('pickerTitle')}

{t('pickerSubtitle')}

); }