import React, { useState } from 'react'; import { useAuth } from './Auth.jsx'; const APPS = [ { label: 'Tavern', href: 'https://amerc.ai/' }, { label: 'Docs', href: 'https://docs.amerc.ai/' }, { label: 'PM', href: 'https://pm.amerc.ai/' }, { label: 'Git', href: 'https://git.amerc.ai/' }, ]; function ConsoleLogin({ auth }) { const [mode, setMode] = useState('login'); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [handle, setHandle] = useState(''); const [err, setErr] = useState(''); const [busy, setBusy] = useState(false); const submit = async (e) => { e.preventDefault(); setErr(''); setBusy(true); try { const { api } = await import('./api.js'); const d = await api(mode === 'login' ? '/auth/login' : '/auth/signup', { method: 'POST', body: { email, password, handle } }); auth.setUser(d.user); } catch (e2) { setErr(e2.message); } finally { setBusy(false); } }; return (
This space is for {requireRole}s only.
Signed in as {auth.user.handle} ({auth.user.role}). Ask an admin for access.
← Back to tavern