Skip to content

Commit

Permalink
Change approach from what was begun in 520a3c8 so that we maintain th…
Browse files Browse the repository at this point in the history
…e correct package name for the purpose of require().
  • Loading branch information
mikermcneil committed Mar 26, 2018
1 parent 520a3c8 commit 9f29a03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/app/configuration/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = function(sails) {
// `--redis` command-line shortcut
session: (function(){
if (overrides.redis) {
return { adapter: 'connect-redis' };
return { adapter: '@sailshq/connect-redis' };
}
return undefined;
})(),
Expand Down
10 changes: 4 additions & 6 deletions lib/hooks/session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ module.exports = function(app) {
if (app.config.session.adapter === 'redis') {
app.config.session.adapter = 'connect-redis';
}
else if (app.config.session.adapter === '@sailshq/connect-redis') {
app.config.session.adapter = 'connect-redis';
}
else if (app.config.session.adapter === 'mongo') {
app.config.session.adapter = 'connect-mongo';
}
Expand Down Expand Up @@ -291,10 +288,11 @@ module.exports = function(app) {
// └─┘└─┘ ┴ └─┘┴ ┴└─└─┘─┴┘┴└─┘ ┴ ┴─┴┘┴ ┴┴ ┴ └─┘┴└─
(function maybeConnectToRedis(proceed) {

// If the adapter isn't set to `connect-redis`, or an existing Redis client is being provided, skip this part.
if (app.config.session.adapter !== 'connect-redis' || app.config.session.client) {
// If the adapter isn't set to `connect-redis`/`@sailshq/connect-redis`,
// or an existing Redis client is being provided, skip this part.
if ((app.config.session.adapter !== 'connect-redis' && app.config.session.adapter !== '@sailshq/connect-redis') || app.config.session.client) {
return proceed();
}
}//•

// If a connection URL is provided, use that, otherwise construct one from the pieces
// provided in the session config.
Expand Down

0 comments on commit 9f29a03

Please sign in to comment.