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
Build and Deploy (Gitea Actions) / build-and-deploy (push) Successful in 2m37s
Details
This commit is contained in:
parent
6f2bc80b0c
commit
a00a0eea13
|
|
@ -54,6 +54,6 @@ export async function POST(req: Request) {
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Change credentials error:', error);
|
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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,6 @@ export async function POST(req: Request) {
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('Admin Login error:', error);
|
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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export default function AdminLoginPage() {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
setError(data.error || 'Erro ao realizar login');
|
setError(data.error + (data.details ? ` (${data.details})` : '') || 'Erro ao realizar login');
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +72,7 @@ export default function AdminLoginPage() {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
setError(data.error || 'Erro ao alterar credenciais');
|
setError(data.error + (data.details ? ` (${data.details})` : '') || 'Erro ao alterar credenciais');
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue