remove passport, added grant

This commit is contained in:
SylvainLap 2015-11-04 17:31:07 +01:00
parent c30edafb60
commit 9359582a8d
3 changed files with 49 additions and 3 deletions

View File

@ -11,7 +11,7 @@ module.exports = {
waterline: true,
bodyParser: true,
session: true,
passport: true,
grant: true,
proxy: true,
ssl: true,
ip: true,

View 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;
};

View File

@ -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",