connect-session-firebase
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -0,1 +1,5 @@ | ||
3.2.0 / 2016-07-19 | ||
================== | ||
* Update Firebase dependency to v3.2.0 | ||
3.1.1 / 2016-07-09 | ||
@@ -2,0 +6,0 @@ ================== |
@@ -138,9 +138,8 @@ /*! | ||
const expires = typeof sess.cookie.maxAge === 'number' ? now + sess.cookie.maxAge : now + oneDayInMilliseconds; | ||
const jsonSess = JSON.stringify(sess); | ||
const session = this.db.ref(this.sessions).child(sid); | ||
session.set({ | ||
expires: JSON.stringify(expires), | ||
type: 'connect-session', | ||
sess: jsonSess | ||
expires: expires, | ||
sess: JSON.stringify(sess), | ||
type: 'connect-session' | ||
}, fn); | ||
@@ -186,3 +185,3 @@ }; | ||
sessions.once('value', snapshot => { | ||
if (snapshot && snapshot.val()) { | ||
if (snapshot.val()) { | ||
snapshot.forEach(session => { | ||
@@ -222,13 +221,11 @@ if (session.val().expires < now) { | ||
session.once('value', snapshot => { | ||
if (!snapshot.val()) { | ||
return fn(); | ||
} | ||
try { | ||
if (!snapshot || !snapshot.val()) { | ||
return fn(); | ||
} | ||
else { | ||
let currentSess = snapshot.val().sess.toString(); | ||
currentSess = JSON.parse(currentSess); | ||
currentSess.cookie = sess.cookie; | ||
let currentSess = JSON.parse(snapshot.val().sess); | ||
currentSess.cookie = sess.cookie; | ||
return this.set(sid, currentSess, fn); | ||
} | ||
return this.set(sid, currentSess, fn); | ||
} | ||
@@ -235,0 +232,0 @@ catch (err) { |
{ | ||
"name": "connect-session-firebase", | ||
"description": "Firebase session store for Connect/Express", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"author": "Ben Weier <ben.weier@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9152
209