mirror of
https://github.com/strapi/strapi.git
synced 2025-11-05 20:36:08 +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');
|
} = require('./validation/auth');
|
||||||
|
|
||||||
const { getAbsoluteAdminUrl, getAbsoluteServerUrl, sanitize } = utils;
|
const { getAbsoluteAdminUrl, getAbsoluteServerUrl, sanitize } = utils;
|
||||||
const { ApplicationError, ValidationError } = utils.errors;
|
const { ApplicationError, ValidationError, ForbiddenError } = utils.errors;
|
||||||
|
|
||||||
const sanitizeUser = (user, ctx) => {
|
const sanitizeUser = (user, ctx) => {
|
||||||
const { auth } = ctx.state;
|
const { auth } = ctx.state;
|
||||||
@ -100,8 +100,8 @@ module.exports = {
|
|||||||
try {
|
try {
|
||||||
const user = await getService('providers').connect(provider, ctx.query);
|
const user = await getService('providers').connect(provider, ctx.query);
|
||||||
|
|
||||||
if (user.blocked === true) {
|
if (user.blocked) {
|
||||||
throw new ApplicationError('Your account is blocked!');
|
throw new ForbiddenError('Your account has been blocked by an administrator');
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.send({
|
return ctx.send({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user