@strapi/plugin-users-permissions 0.0.0-next.ce51df0e18404afc8a1aa7f504c1006a7a221459 → 0.0.0-next.d010ff3a1ec0f4358fc2c66651621b87ade1322d
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.
package/admin/src/index.js
CHANGED
|
@@ -32,8 +32,13 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
id: 'roles',
|
|
34
34
|
to: `/settings/users-permissions/roles`,
|
|
35
|
-
Component
|
|
36
|
-
|
|
35
|
+
async Component() {
|
|
36
|
+
const component = await import(
|
|
37
|
+
/* webpackChunkName: "users-roles-settings-page" */ './pages/Roles'
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return component;
|
|
41
|
+
},
|
|
37
42
|
permissions: PERMISSIONS.accessRoles,
|
|
38
43
|
},
|
|
39
44
|
{
|
|
@@ -43,8 +48,13 @@ export default {
|
|
|
43
48
|
},
|
|
44
49
|
id: 'providers',
|
|
45
50
|
to: `/settings/users-permissions/providers`,
|
|
46
|
-
Component
|
|
47
|
-
|
|
51
|
+
async Component() {
|
|
52
|
+
const component = await import(
|
|
53
|
+
/* webpackChunkName: "users-providers-settings-page" */ './pages/Providers'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return component;
|
|
57
|
+
},
|
|
48
58
|
permissions: PERMISSIONS.readProviders,
|
|
49
59
|
},
|
|
50
60
|
{
|
|
@@ -54,8 +64,13 @@ export default {
|
|
|
54
64
|
},
|
|
55
65
|
id: 'email-templates',
|
|
56
66
|
to: `/settings/users-permissions/email-templates`,
|
|
57
|
-
Component
|
|
58
|
-
|
|
67
|
+
async Component() {
|
|
68
|
+
const component = await import(
|
|
69
|
+
/* webpackChunkName: "users-email-settings-page" */ './pages/EmailTemplates'
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return component;
|
|
73
|
+
},
|
|
59
74
|
permissions: PERMISSIONS.readEmailTemplates,
|
|
60
75
|
},
|
|
61
76
|
{
|
|
@@ -65,10 +80,13 @@ export default {
|
|
|
65
80
|
},
|
|
66
81
|
id: 'advanced-settings',
|
|
67
82
|
to: `/settings/users-permissions/advanced-settings`,
|
|
68
|
-
Component
|
|
69
|
-
import(
|
|
83
|
+
async Component() {
|
|
84
|
+
const component = await import(
|
|
70
85
|
/* webpackChunkName: "users-advanced-settings-page" */ './pages/AdvancedSettings'
|
|
71
|
-
)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return component;
|
|
89
|
+
},
|
|
72
90
|
permissions: PERMISSIONS.readAdvancedSettings,
|
|
73
91
|
},
|
|
74
92
|
]
|
|
@@ -145,7 +145,11 @@ export const CreatePage = () => {
|
|
|
145
145
|
id: 'global.name',
|
|
146
146
|
defaultMessage: 'Name',
|
|
147
147
|
})}
|
|
148
|
-
error={
|
|
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
|
|
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={
|
|
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
|
|
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": "0.0.0-next.
|
|
3
|
+
"version": "0.0.0-next.d010ff3a1ec0f4358fc2c66651621b87ade1322d",
|
|
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.
|
|
33
|
-
"@strapi/helper-plugin": "0.0.0-next.
|
|
34
|
-
"@strapi/icons": "1.
|
|
35
|
-
"@strapi/utils": "0.0.0-next.
|
|
32
|
+
"@strapi/design-system": "1.11.0",
|
|
33
|
+
"@strapi/helper-plugin": "0.0.0-next.d010ff3a1ec0f4358fc2c66651621b87ade1322d",
|
|
34
|
+
"@strapi/icons": "1.11.0",
|
|
35
|
+
"@strapi/utils": "0.0.0-next.d010ff3a1ec0f4358fc2c66651621b87ade1322d",
|
|
36
36
|
"bcryptjs": "2.4.3",
|
|
37
37
|
"formik": "2.4.0",
|
|
38
38
|
"grant-koa": "5.4.8",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@testing-library/dom": "9.2.0",
|
|
55
55
|
"@testing-library/react": "14.0.0",
|
|
56
56
|
"@testing-library/user-event": "14.4.3",
|
|
57
|
-
"msw": "1.
|
|
57
|
+
"msw": "1.3.0",
|
|
58
58
|
"react": "^18.2.0",
|
|
59
59
|
"react-dom": "^18.2.0",
|
|
60
60
|
"react-router-dom": "5.3.4",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"required": true,
|
|
78
78
|
"kind": "plugin"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d010ff3a1ec0f4358fc2c66651621b87ade1322d"
|
|
81
81
|
}
|
|
@@ -113,7 +113,8 @@ const userSchemaAdditions = () => {
|
|
|
113
113
|
'updatedBy',
|
|
114
114
|
'updatedAt',
|
|
115
115
|
'publishedAt',
|
|
116
|
-
'
|
|
116
|
+
'strapi_stage',
|
|
117
|
+
'strapi_assignee',
|
|
117
118
|
];
|
|
118
119
|
|
|
119
120
|
return currentSchema.filter((key) => !(ignoreDiffs.includes(key) || defaultSchema.includes(key)));
|
|
@@ -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),
|