diff --git a/susconecta/app/(auth)/login-admin/page.tsx b/susconecta/app/(auth)/login-admin/page.tsx index 544ef43..03260c8 100644 --- a/susconecta/app/(auth)/login-admin/page.tsx +++ b/susconecta/app/(auth)/login-admin/page.tsx @@ -3,7 +3,6 @@ import { useState } from 'react' import { useRouter } from 'next/navigation' import Link from 'next/link' import { useAuth } from '@/hooks/useAuth' -import { sendMagicLink } from '@/lib/api' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' @@ -13,9 +12,7 @@ import { AuthenticationError } from '@/lib/auth' export default function LoginAdminPage() { const [credentials, setCredentials] = useState({ email: '', password: '' }) const [error, setError] = useState('') - const [magicMessage, setMagicMessage] = useState('') - const [magicError, setMagicError] = useState('') - const [magicLoading, setMagicLoading] = useState(false) + const [loading, setLoading] = useState(false) const router = useRouter() const { login } = useAuth() @@ -48,26 +45,7 @@ export default function LoginAdminPage() { } } - const handleSendMagicLink = async () => { - if (!credentials.email) { - setMagicError('Por favor, preencha o email antes de solicitar o magic link.') - return - } - - setMagicLoading(true) - setMagicError('') - setMagicMessage('') - - try { - const res = await sendMagicLink(credentials.email, { target: 'admin' }) - setMagicMessage(res?.message ?? 'Magic link enviado. Verifique seu email.') - } catch (err: any) { - console.error('[MAGIC-LINK ADMIN] erro ao enviar:', err) - setMagicError(err?.message ?? String(err)) - } finally { - setMagicLoading(false) - } - } + return (
@@ -133,25 +111,7 @@ export default function LoginAdminPage() { {loading ? 'Entrando...' : 'Entrar no Sistema Administrativo'} -
-
Ou entre usando um magic link (sem senha)
- - {magicError && ( - - {magicError} - - )} - - {magicMessage && ( - - {magicMessage} - - )} - - -
+
-
-
Ou entre usando um magic link (sem senha)
- - {magicError && ( - - {magicError} - - )} - - {magicMessage && ( - - {magicMessage} - - )} - - -
+
-
-
Ou entre usando um magic link (sem senha)
- - {magicError && ( - - {magicError} - - )} - - {magicMessage && ( - - {magicMessage} - - )} - - -
+