flowstate
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -35,3 +35,3 @@ var SessionStore = require('../stores/session'); | ||
} else if (ttl && age > ttl) { | ||
store.destroy(req, state.handle, iter); | ||
store.expire(req, state.handle, iter); | ||
} else { | ||
@@ -38,0 +38,0 @@ iter(); |
@@ -45,5 +45,8 @@ var uid = require('uid-safe').sync; | ||
state.handle = h; | ||
if (options.destroy === true) { | ||
if (state.expired) { | ||
this.destroy(req, h, function(){}); | ||
return cb(new Error('login process has timed out, please try again')); | ||
} else if (options.destroy === true) { | ||
this.destroy(req, h, function(){}); | ||
return cb(null, state); | ||
@@ -96,3 +99,13 @@ } else { | ||
SessionStore.prototype.expire = function(req, h, cb) { | ||
var key = this._key; | ||
if (!req.session || !req.session[key] || !req.session[key][h]) { | ||
return cb(); | ||
} | ||
module.exports = SessionStore; | ||
req.session[key][h].expired = true; | ||
return cb(); | ||
} | ||
module.exports = SessionStore; |
{ | ||
"name": "flowstate", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Stateful, transactional flows using page-based navigation.", | ||
@@ -5,0 +5,0 @@ "author": { |
11547
275