Skip to content

Commit

Permalink
Removed search params from custom signup redirects (#12386)
Browse files Browse the repository at this point in the history
refs #12366

This means that custom redirects will not trigger the built in notifications handled by Portal.
  • Loading branch information
allouis committed Nov 19, 2020
1 parent 49197a6 commit 38d19c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/server/services/members/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 38d19c9

Please sign in to comment.