mweibel / connect-session-sequelize

Sequelize SessionStore for Express/Connect
211 stars 71 forks source link

Default options in code inconsistent with documentation #142

Closed redevill closed 1 year ago

redevill commented 1 year ago

Discovered that the DOCS and CODE are at odds - when upgrading versions: The table in my database was already created as "Session" the default at the time. Then after the upgrade, Login failed, as the Sql statement was hitting table FROM "Sessions" as "Session".

Hopefully we can change the DOCS? Add a "Breaking Change" Note? Regarding the default change?

DOCUMENTATION: modelKey (optional) a string for the key in sequelize's models-object but it is also the name of the class to which it references (conventionally written in Camelcase) that's why it is "Session" by default if table is not defined. tableName (optional) a string for naming the generated table if table is not defined. Default is the value of modelKey.

CODE (connect-session-sequelize.js line 11): const defaultOptions = { checkExpirationInterval: 15 60 1000, expiration: 24 60 60 * 1000, disableTouch: false, modelKey: 'Session', tableName: 'Sessions' // Table name should be Session to agree with Docs and previous versions. }

Thanks

mweibel commented 1 year ago

thanks for the report. That sounds unfortunate. You're welcome to submit a PR with proposed changes.