const MOCK_EMAIL = 'admin@licitatche.gov.br' const MOCK_PASSWORD = 'admin123' interface AuthUser { nome: string email: string papel: string } export function useAuth() { const user = useState('auth_user', () => null) const token = useCookie('auth_token', { maxAge: 60 * 60 * 8 }) const isAuthenticated = computed(() => !!token.value) if (token.value && !user.value) { user.value = { nome: 'Admin', email: MOCK_EMAIL, papel: 'Administrador' } } async function login(email: string, password: string): Promise<{ success: boolean; error?: string }> { if (email === MOCK_EMAIL && password === MOCK_PASSWORD) { token.value = 'mock_token_' + Date.now() user.value = { nome: 'Admin', email, papel: 'Administrador' } return { success: true } } return { success: false, error: 'E-mail ou senha incorretos.' } } function logout() { token.value = null user.value = null navigateTo('/login') } return { user, isAuthenticated, login, logout } }