Skip to content

Commit

Permalink
Keep returnTo when using successReturnToOrRedirect
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamwhiteuk committed Oct 12, 2023
1 parent cfdbd4a commit fd41914
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sessionmanager.js
Expand Up @@ -36,6 +36,8 @@ SessionManager.prototype.logIn = function(req, user, options, cb) {
}
if (options.keepSessionInfo) {
merge(req.session, prevSession);
} else if (options.successReturnToOrRedirect && prevSession.returnTo) {
req.session.returnTo = prevSession.returnTo;
}
if (!req.session[self._key]) {
req.session[self._key] = {};
Expand Down

0 comments on commit fd41914

Please sign in to comment.