Use same error format

This commit is contained in:
Alexandre Bodin 2021-08-24 10:14:42 +02:00
parent c1329f2284
commit d598cfaf71

View File

@ -283,7 +283,7 @@ module.exports = {
null, null,
formatError({ formatError({
id: 'Auth.form.error.email.format', id: 'Auth.form.error.email.format',
message: 'Please provide valid email address.', message: 'Please provide a valid email address.',
}) })
); );
} }
@ -312,7 +312,13 @@ module.exports = {
// User blocked // User blocked
if (user.blocked) { if (user.blocked) {
return ctx.badRequest('blocked.user'); return ctx.badRequest(
null,
formatError({
id: 'Auth.form.error.user.blocked',
message: 'This user is disabled.',
})
);
} }
// Generate random token. // Generate random token.