fix: localize validation and api messages
All checks were successful
CI / Validate frontend and API (push) Successful in 39s
CI / Build and publish Docker images (push) Successful in 22s

This commit is contained in:
Cauê Faleiros
2026-09-08 13:40:38 -03:00
parent 987eb210eb
commit ad736758a7
17 changed files with 97 additions and 82 deletions

View File

@@ -34,7 +34,7 @@ const registerAuth: FastifyPluginAsync = async (app) => {
try {
await request.jwtVerify();
} catch {
reply.code(401).send({ error: 'Authentication required' });
reply.code(401).send({ error: 'Autenticação necessária.' });
return false;
}
@@ -44,7 +44,7 @@ const registerAuth: FastifyPluginAsync = async (app) => {
);
const account = result.rows[0];
if (!account) {
reply.code(401).send({ error: 'This account is no longer active' });
reply.code(401).send({ error: 'Esta conta não está mais ativa.' });
return false;
}
@@ -61,7 +61,7 @@ const registerAuth: FastifyPluginAsync = async (app) => {
if (!(await verifyActiveUser(request, reply))) return;
if (!roles.includes(request.user.role)) {
return reply.code(403).send({ error: 'Insufficient permissions' });
return reply.code(403).send({ error: 'Você não tem permissão para esta ação.' });
}
});
};