Skip to content

Commit

Permalink
Permite agregar el maxage
Browse files Browse the repository at this point in the history
  • Loading branch information
emilioplatzer committed Jul 28, 2016
1 parent 3aaec09 commit 5fdd96a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/login-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function completeOptions(opts){
formTitle:'login',
formImg:'Oxygen480-actions-key-enter.svg.png',
autoLogin:false
}
},
maxAge: 15*60*1000
}, opts || {});
opts.loginPageServe = opts.loginPageServe || function(req, res, next){
var flashInfo=req.flash();
Expand Down Expand Up @@ -105,6 +106,8 @@ loginPlus.Manager.prototype.init = function init(app,opts){
secret: opts.secret || this.secret,
resave: false,
saveUninitialized: true,
rolling: true,
cookie: { maxAge: opts.maxAge }
};
if(opts.fileStore===true){
var FileStore = require('session-file-store')(session);
Expand All @@ -113,7 +116,7 @@ loginPlus.Manager.prototype.init = function init(app,opts){
app.use(session(sessionOpts));
app.use(connectFlash());
app.use(passport.initialize());
app.use(passport.session({ secret: this.secret, cookie: { maxAge: 60000 } }));
app.use(passport.session());
var fileNameLogin=opts.fileNameLogin||'login.jade';
promiseChain = promiseChain.then(function(){
return fs.exists(fileNameLogin);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "login-plus",
"description": "login service for express",
"version": "0.6.1",
"version": "0.6.2",
"author": "Codenautas <codenautas@googlegroups.com>",
"license": "MIT",
"repository": "codenautas/login-plus",
Expand Down

0 comments on commit 5fdd96a

Please sign in to comment.