Commit c4afb788 authored by Porchet Gaetan's avatar Porchet Gaetan
Browse files

ajout base auth

parent 47f6036a
......@@ -78,5 +78,22 @@ app.use(function(err, req, res, next) {
});
});
// config auth
app.use(session({
cookieName: 'session',
secret: 'keyboard cat',
resave: false,
saveUninitialized: false
}));
module.exports = app;
\ No newline at end of file
app.use(passport.initialize());
app.use(passport.session());
var Account = require('./models/users');
passport.use(new LocalStrategy(Account.authenticate()));
passport.serializeUser(Account.serializeUser());
passport.deserializeUser(Account.deserializeUser());
module.exports = app;
......@@ -3,13 +3,18 @@
"version": "0.0.1",
"description": "A starter kit to kickstart your expressjs projects.",
"dependencies": {
"body-parser": "^1.10.2",
"cookie-parser": "~1.3.3",
"body-parser": "^1.18.3",
"cookie-parser": "^1.3.5",
"debug": "^4.1.0",
"express": "^4.16.4",
"mongoose": "^5.3.7",
"express-session": "^1.15.6",
"mongoose": "^5.3.15",
"morgan": "^1.9.1",
"nunjucks": "^3.1.3",
"serve-favicon": "^2.5.0"
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"passport-local-mongoose": "^5.0.1",
"serve-favicon": "^2.5.0",
"tern-node-express": "^0.4.0"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment