diff --git a/controllers/homework.js b/controllers/homework.js index 1a87b5ca0d..f908914e21 100644 --- a/controllers/homework.js +++ b/controllers/homework.js @@ -370,8 +370,7 @@ const getDeleteHandler = (service, redirectToReferer) => (req, res, next) => { if (redirectToReferer) { redirectHelper.safeBackRedirect(req, res); } else { - res.sendStatus(200); - res.redirect(`/${service}`); + res.redirect(200, `/${service}`); } }).catch((err) => { next(err); diff --git a/controllers/oauth2.js b/controllers/oauth2.js index 3e0c6c9731..0b47996516 100644 --- a/controllers/oauth2.js +++ b/controllers/oauth2.js @@ -149,10 +149,9 @@ router.get('/username/:pseudonym', async (req, res, next) => { if (Configuration.get('FEATURE_CTL_TOOLS_TAB_ENABLED')) { const pseudonymResponse = await api(req, { version: 'v3' }) .get(`/pseudonyms/${req.params.pseudonym}`); - const userResponse = await api(req) .get('/users', { - qs: { id: pseudonymResponse.userId }, + qs: { _id: pseudonymResponse.userId }, $limit: 1, }); if (userResponse.data.length) {