@strapi/plugin-users-permissions 4.14.0-alpha.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,7 +145,11 @@ export const CreatePage = () => {
145
145
  id: 'global.name',
146
146
  defaultMessage: 'Name',
147
147
  })}
148
- error={errors?.name ? formatMessage({ id: errors.name }) : false}
148
+ error={
149
+ errors?.name
150
+ ? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
151
+ : false
152
+ }
149
153
  required
150
154
  />
151
155
  </GridItem>
@@ -159,7 +163,12 @@ export const CreatePage = () => {
159
163
  defaultMessage: 'Description',
160
164
  })}
161
165
  error={
162
- errors?.description ? formatMessage({ id: errors.description }) : false
166
+ errors?.description
167
+ ? formatMessage({
168
+ id: errors.description,
169
+ defaultMessage: 'Description is required',
170
+ })
171
+ : false
163
172
  }
164
173
  required
165
174
  />
@@ -166,7 +166,11 @@ export const EditPage = () => {
166
166
  id: 'global.name',
167
167
  defaultMessage: 'Name',
168
168
  })}
169
- error={errors?.name ? formatMessage({ id: errors.name }) : false}
169
+ error={
170
+ errors?.name
171
+ ? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
172
+ : false
173
+ }
170
174
  required
171
175
  />
172
176
  </GridItem>
@@ -180,7 +184,12 @@ export const EditPage = () => {
180
184
  defaultMessage: 'Description',
181
185
  })}
182
186
  error={
183
- errors?.description ? formatMessage({ id: errors.description }) : false
187
+ errors?.description
188
+ ? formatMessage({
189
+ id: errors.description,
190
+ defaultMessage: 'Description is required',
191
+ })
192
+ : false
184
193
  }
185
194
  required
186
195
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-users-permissions",
3
- "version": "4.14.0-alpha.0",
3
+ "version": "4.14.0",
4
4
  "description": "Protect your API with a full-authentication process based on JWT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,10 +29,10 @@
29
29
  "lint": "run -T eslint ."
30
30
  },
31
31
  "dependencies": {
32
- "@strapi/design-system": "1.9.0",
33
- "@strapi/helper-plugin": "4.14.0-alpha.0",
34
- "@strapi/icons": "1.9.0",
35
- "@strapi/utils": "4.14.0-alpha.0",
32
+ "@strapi/design-system": "1.11.0",
33
+ "@strapi/helper-plugin": "4.14.0",
34
+ "@strapi/icons": "1.11.0",
35
+ "@strapi/utils": "4.14.0",
36
36
  "bcryptjs": "2.4.3",
37
37
  "formik": "2.4.0",
38
38
  "grant-koa": "5.4.8",
@@ -77,5 +77,5 @@
77
77
  "required": true,
78
78
  "kind": "plugin"
79
79
  },
80
- "gitHead": "1c3c286e2481cd8cbbb50e0e0bb8fbd0b824d2e4"
80
+ "gitHead": "09b6d7a4b46a87142d29665052ca22ced29fa56a"
81
81
  }
@@ -26,7 +26,7 @@ const {
26
26
  } = require('./validation/auth');
27
27
 
28
28
  const { getAbsoluteAdminUrl, getAbsoluteServerUrl, sanitize } = utils;
29
- const { ApplicationError, ValidationError } = utils.errors;
29
+ const { ApplicationError, ValidationError, ForbiddenError } = utils.errors;
30
30
 
31
31
  const sanitizeUser = (user, ctx) => {
32
32
  const { auth } = ctx.state;
@@ -100,6 +100,10 @@ module.exports = {
100
100
  try {
101
101
  const user = await getService('providers').connect(provider, ctx.query);
102
102
 
103
+ if (user.blocked) {
104
+ throw new ForbiddenError('Your account has been blocked by an administrator');
105
+ }
106
+
103
107
  return ctx.send({
104
108
  jwt: getService('jwt').issue({ id: user.id }),
105
109
  user: await sanitizeUser(user, ctx),