Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Fix URI encoding and decoding on login redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Skukan committed Feb 10, 2017
1 parent 80cf1a4 commit fd04ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/controllers/login.js
Expand Up @@ -81,10 +81,10 @@ module.exports = function (req, res, next) {
},
'text/html': function () {
var nextUri = url.parse(req.query.next || '').path;
var formActionUri = (config.web.login.uri + (nextUri ? ('?next=' + nextUri) : ''));
var formActionUri = (config.web.login.uri + (nextUri ? ('?next=' + encodeURIComponent(nextUri)) : ''));

if (req.user && config.web.login.enabled) {
var nextUrl = nextUri || config.web.login.nextUri;
var nextUrl = nextUri || decodeURIComponent(config.web.login.nextUri);
return res.redirect(302, nextUrl);
}

Expand Down

0 comments on commit fd04ce6

Please sign in to comment.