mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 16:16:20 +00:00
Merge pull request #17 from sylvainlap/improvement/passport
Passport is now a hook
This commit is contained in:
commit
5939128d1c
@ -12,6 +12,7 @@ module.exports = {
|
||||
waterline: true,
|
||||
bodyParser: true,
|
||||
session: true,
|
||||
passport: true,
|
||||
proxy: true,
|
||||
ssl: true,
|
||||
ip: true,
|
||||
|
||||
36
lib/configuration/hooks/passport/index.js
Normal file
36
lib/configuration/hooks/passport/index.js
Normal file
@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Passport hook
|
||||
*/
|
||||
|
||||
module.exports = function (strapi) {
|
||||
const hook = {
|
||||
|
||||
/**
|
||||
* Default options
|
||||
*/
|
||||
|
||||
defaults: {
|
||||
passport: {
|
||||
strategies: {
|
||||
local: {
|
||||
strategy: 'passport-local'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the hook
|
||||
*/
|
||||
|
||||
initialize: function (cb) {
|
||||
strapi.app.use(strapi.middlewares.passport.initialize());
|
||||
|
||||
cb();
|
||||
}
|
||||
};
|
||||
|
||||
return hook;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user