ca98am79 / connect-dynamodb

DynamoDB session store for Connect
http://ca98am79.github.com/connect-dynamodb/
MIT License
144 stars 66 forks source link

Support passing express-session directly as a param in init #54

Closed therealsanmah closed 5 years ago

therealsanmah commented 5 years ago

Allow the flexibility to pass the express-session directly as a parameter to the adapter constructor.

Today, then way connect-dynamodb seems to allow initialization is like this:

var session = require('express-session');
var DynamoDBStore = require('connect-dynamodb')({session: session});

Where as frameworks such as sails, initialize the store like this. Consequently, connect-dynamodb is not directly compatible with sails, which is gaining popularity quickly.

The issue is to request support initialisation by passing the express-session directly as a param. Like this:

var DynamoDBStore = require('connect-dynamodb')(require('express-session'));

This is today also supported by connect-mongo and will bring us feature-parity.

ca98am79 commented 5 years ago

thanks!