fix: adicionar detalhes do erro 500 na interface de login do admin para debug
Build and Deploy (Gitea Actions) / build-and-deploy (push) Successful in 2m37s Details

This commit is contained in:
Sidney 2026-06-07 21:08:02 -03:00
parent 6f2bc80b0c
commit a00a0eea13
3 changed files with 4 additions and 4 deletions

View File

@ -54,6 +54,6 @@ export async function POST(req: Request) {
} catch (error: any) {
console.error('Change credentials error:', error);
return NextResponse.json({ error: 'Erro interno do servidor' }, { status: 500 });
return NextResponse.json({ error: 'Erro interno do servidor', details: error.message }, { status: 500 });
}
}

View File

@ -57,6 +57,6 @@ export async function POST(req: Request) {
} catch (error: any) {
console.error('Admin Login error:', error);
return NextResponse.json({ error: 'Erro interno do servidor' }, { status: 500 });
return NextResponse.json({ error: 'Erro interno do servidor', details: error.message }, { status: 500 });
}
}

View File

@ -34,7 +34,7 @@ export default function AdminLoginPage() {
const data = await res.json();
if (!res.ok) {
setError(data.error || 'Erro ao realizar login');
setError(data.error + (data.details ? ` (${data.details})` : '') || 'Erro ao realizar login');
setLoading(false);
return;
}
@ -72,7 +72,7 @@ export default function AdminLoginPage() {
const data = await res.json();
if (!res.ok) {
setError(data.error || 'Erro ao alterar credenciais');
setError(data.error + (data.details ? ` (${data.details})` : '') || 'Erro ao alterar credenciais');
setLoading(false);
return;
}