mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
changed the error type from application to forbidden
This commit is contained in:
parent
a8149c55fd
commit
ae06d7f100
@ -26,7 +26,7 @@ const {
|
||||
} = require('./validation/auth');
|
||||
|
||||
const { getAbsoluteAdminUrl, getAbsoluteServerUrl, sanitize } = utils;
|
||||
const { ApplicationError, ValidationError } = utils.errors;
|
||||
const { ApplicationError, ValidationError, ForbiddenError } = utils.errors;
|
||||
|
||||
const sanitizeUser = (user, ctx) => {
|
||||
const { auth } = ctx.state;
|
||||
@ -100,8 +100,8 @@ module.exports = {
|
||||
try {
|
||||
const user = await getService('providers').connect(provider, ctx.query);
|
||||
|
||||
if (user.blocked === true) {
|
||||
throw new ApplicationError('Your account is blocked!');
|
||||
if (user.blocked) {
|
||||
throw new ForbiddenError('Your account has been blocked by an administrator');
|
||||
}
|
||||
|
||||
return ctx.send({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user