diff --git a/core/server/services/members/middleware.js b/core/server/services/members/middleware.js index a60fcb5329..d6341e9f95 100644 --- a/core/server/services/members/middleware.js +++ b/core/server/services/members/middleware.js @@ -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);