mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +00:00
remove passport, added grant
This commit is contained in:
parent
c30edafb60
commit
9359582a8d
@ -11,7 +11,7 @@ module.exports = {
|
||||
waterline: true,
|
||||
bodyParser: true,
|
||||
session: true,
|
||||
passport: true,
|
||||
grant: true,
|
||||
proxy: true,
|
||||
ssl: true,
|
||||
ip: true,
|
||||
|
||||
46
lib/configuration/hooks/grant/index.js
Normal file
46
lib/configuration/hooks/grant/index.js
Normal file
@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
// Public node modules.
|
||||
const _ = require('lodash');
|
||||
const Grant = require('grant-koa');
|
||||
|
||||
/**
|
||||
* Grant hook
|
||||
*/
|
||||
|
||||
module.exports = function (strapi) {
|
||||
const hook = {
|
||||
|
||||
/**
|
||||
* Default options
|
||||
*/
|
||||
|
||||
defaults: {
|
||||
grant: {}
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the hook
|
||||
*/
|
||||
|
||||
initialize: function (cb) {
|
||||
const serverConf = {
|
||||
server: {
|
||||
protocol: strapi.config.ssl ? 'https' : 'http',
|
||||
host: strapi.config.host + ':' + strapi.config.port
|
||||
}
|
||||
};
|
||||
_.defaultsDeep(strapi.config.grant, serverConf);
|
||||
const grant = new Grant(strapi.config.grant);
|
||||
strapi.app.use(strapi.middlewares.mount(grant));
|
||||
|
||||
cb();
|
||||
}
|
||||
};
|
||||
|
||||
return hook;
|
||||
};
|
||||
@ -7,6 +7,7 @@
|
||||
"api",
|
||||
"auth",
|
||||
"framework",
|
||||
"grant",
|
||||
"graphql",
|
||||
"koa",
|
||||
"koajs",
|
||||
@ -15,7 +16,6 @@
|
||||
"oauth",
|
||||
"oauth2",
|
||||
"orm",
|
||||
"passport",
|
||||
"realtime",
|
||||
"rest",
|
||||
"restful",
|
||||
@ -36,6 +36,7 @@
|
||||
"commander": "^2.9.0",
|
||||
"consolidate": "^0.13.1",
|
||||
"fs-extra": "^0.24.0",
|
||||
"grant-koa": "^3.5.2",
|
||||
"graphql": "^0.4.9",
|
||||
"include-all": "^0.1.6",
|
||||
"json-stringify-safe": "^5.0.1",
|
||||
@ -52,7 +53,6 @@
|
||||
"koa-locale": "^1.0.0",
|
||||
"koa-lusca": "^2.1.0",
|
||||
"koa-mount": "^1.3.0",
|
||||
"koa-passport": "^1.2.0",
|
||||
"koa-proxy": "^0.4.1",
|
||||
"koa-response-time": "^1.0.2",
|
||||
"koa-router": "^5.2.3",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user