mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
remove passport, added grant
This commit is contained in:
parent
c30edafb60
commit
9359582a8d
@ -11,7 +11,7 @@ module.exports = {
|
|||||||
waterline: true,
|
waterline: true,
|
||||||
bodyParser: true,
|
bodyParser: true,
|
||||||
session: true,
|
session: true,
|
||||||
passport: true,
|
grant: true,
|
||||||
proxy: true,
|
proxy: true,
|
||||||
ssl: true,
|
ssl: true,
|
||||||
ip: 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",
|
"api",
|
||||||
"auth",
|
"auth",
|
||||||
"framework",
|
"framework",
|
||||||
|
"grant",
|
||||||
"graphql",
|
"graphql",
|
||||||
"koa",
|
"koa",
|
||||||
"koajs",
|
"koajs",
|
||||||
@ -15,7 +16,6 @@
|
|||||||
"oauth",
|
"oauth",
|
||||||
"oauth2",
|
"oauth2",
|
||||||
"orm",
|
"orm",
|
||||||
"passport",
|
|
||||||
"realtime",
|
"realtime",
|
||||||
"rest",
|
"rest",
|
||||||
"restful",
|
"restful",
|
||||||
@ -36,6 +36,7 @@
|
|||||||
"commander": "^2.9.0",
|
"commander": "^2.9.0",
|
||||||
"consolidate": "^0.13.1",
|
"consolidate": "^0.13.1",
|
||||||
"fs-extra": "^0.24.0",
|
"fs-extra": "^0.24.0",
|
||||||
|
"grant-koa": "^3.5.2",
|
||||||
"graphql": "^0.4.9",
|
"graphql": "^0.4.9",
|
||||||
"include-all": "^0.1.6",
|
"include-all": "^0.1.6",
|
||||||
"json-stringify-safe": "^5.0.1",
|
"json-stringify-safe": "^5.0.1",
|
||||||
@ -52,7 +53,6 @@
|
|||||||
"koa-locale": "^1.0.0",
|
"koa-locale": "^1.0.0",
|
||||||
"koa-lusca": "^2.1.0",
|
"koa-lusca": "^2.1.0",
|
||||||
"koa-mount": "^1.3.0",
|
"koa-mount": "^1.3.0",
|
||||||
"koa-passport": "^1.2.0",
|
|
||||||
"koa-proxy": "^0.4.1",
|
"koa-proxy": "^0.4.1",
|
||||||
"koa-response-time": "^1.0.2",
|
"koa-response-time": "^1.0.2",
|
||||||
"koa-router": "^5.2.3",
|
"koa-router": "^5.2.3",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user