Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirectBySlug doesnt keep querystring values #9698

Closed
uplift opened this issue Aug 12, 2021 · 0 comments
Closed

redirectBySlug doesnt keep querystring values #9698

uplift opened this issue Aug 12, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@uplift
Copy link
Contributor

uplift commented Aug 12, 2021

Trying to call DELETE /api/v3/users/bySlug/:userslug/sessions/:uuid with master token and _uid querystring goes through the below function and redirects and errors with 'A master token was received without a corresponding _uid' as the req.query isnt passed through on the redirect.

Users.redirectBySlug = async (req, res) => {
const uid = await user.getUidByUserslug(req.params.userslug);
if (uid) {
const path = req.path.split('/').slice(3).join('/');
res.redirect(308, nconf.get('relative_path') + encodeURI(`/api/v3/users/${uid}/${path}`));
} else {
helpers.formatApiResponse(404, res);
}
};

@barisusakli barisusakli self-assigned this Aug 12, 2021
@barisusakli barisusakli added this to the 1.18.0 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants