You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #97, the default option for `tableName` was set as `Sessions`.
However, given the previous logic for resolving options provided, the
default was never utilised (`options.tableName` was used, which never
[considered](https://github.com/mweibel/connect-session-sequelize/blob/394645289e17c2e962fe6650729b3f0e691a3134/lib/connect-session-sequelize.js#L68)
the `defaultOptions` object). This was discovered on a database with no
`CREATE` privileges where it tried to create a table called `Session`;
this database had a pre-existing `Sessions` table that was created with
an older version of `connect-session-sequelize`
This change simplifies and cleans up the options lookup process,
canonically using `this.options` for all options, ensuring
`defaultOptions` is introduced during construction of the
SequelizeStore.
Additionally, this change fixes a subtle bug - the previous use of the
`Object.assign` function had the side effect of modifying the first
argument provided, which was the `defaultOptions` object. This would
have impacted subsequent session stores as the defaults were
accidentally modified by the first session store. The impact of this is
isolated since an app with only 1 store wouldn't be affected and
the original constructor didn't actually use the defaults (see above).
This change adds various additional tests to ensure the option
resolution succeeds.
0 commit comments