mirror of
https://github.com/strapi/strapi.git
synced 2025-11-26 23:22:01 +00:00
Do not load Grant middleware without user API
This commit is contained in:
parent
0609ce7a6c
commit
3bd7d2ea4b
@ -28,15 +28,16 @@ module.exports = function (strapi) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
initialize: function (cb) {
|
initialize: function (cb) {
|
||||||
_.defaultsDeep(strapi.api.user.config.grant, {
|
if (_.isPlainObject(strapi.api.user)) {
|
||||||
server: {
|
_.defaultsDeep(strapi.api.user.config.grant, {
|
||||||
protocol: strapi.config.ssl ? 'https' : 'http',
|
server: {
|
||||||
host: strapi.config.host + ':' + strapi.config.port
|
protocol: strapi.config.ssl ? 'https' : 'http',
|
||||||
}
|
host: strapi.config.host + ':' + strapi.config.port
|
||||||
});
|
}
|
||||||
const grant = new Grant(strapi.api.user.config.grant);
|
});
|
||||||
|
const grant = new Grant(strapi.api.user.config.grant);
|
||||||
strapi.app.use(strapi.middlewares.mount(grant));
|
strapi.app.use(strapi.middlewares.mount(grant));
|
||||||
|
}
|
||||||
|
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user