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

Add URI encoding and decoding on login redirect #596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/controllers/login.js
Original file line number Diff line number Diff line change
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