From 8b7754f9467240c9fd89169cc8cbd083f3ea29a7 Mon Sep 17 00:00:00 2001 From: agnisa-cap Date: Fri, 22 Sep 2023 14:51:56 +0200 Subject: [PATCH] N21-1269 pseudonym username fix (#3312) --- controllers/oauth2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) {