Removed search params from custom signup redirects (#12386)

refs #12366

This means that custom redirects will not trigger the built in notifications handled by Portal.
This commit is contained in:
Fabien 'egg' O'Carroll 2020-11-19 14:47:08 +00:00 committed by GitHub
parent 49197a6597
commit 38d19c999d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,9 +154,12 @@ const createSessionFromMagicLink = async function (req, res, next) {
}
}
// Do a standard 302 redirect, with success=true
searchParams.set('success', true);
res.redirect(`${urlUtils.getSubdir()}${redirectPath}?${searchParams.toString()}`);
if (redirectPath === '/') {
searchParams.set('success', true);
redirectPath = redirectPath + '?' + searchParams.toString();
}
res.redirect(`${urlUtils.getSubdir()}${redirectPath}`);
} catch (err) {
logging.warn(err.message);