mweibel / connect-session-sequelize

Sequelize SessionStore for Express/Connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default options in code inconsistent with documentation

redevill opened this issue · comments

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?

  • And this issue may provide relief for anyone else :)

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

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