From 896509252319ba7ab1365bc1d117f3eaf16f0890 Mon Sep 17 00:00:00 2001 From: Arne Gnisa Date: Fri, 22 Sep 2023 13:06:14 +0200 Subject: [PATCH 1/2] N21-1269 fix --- controllers/oauth2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/oauth2.js b/controllers/oauth2.js index aadc175442..f5354e4b4d 100644 --- a/controllers/oauth2.js +++ b/controllers/oauth2.js @@ -155,7 +155,7 @@ router.get('/username/:pseudonym', async (req, res, next) => { qs: { id: pseudonymResponse.userId }, $limit: 1, }); - if (userResponse.data?.length === 1) { + if (userResponse.data?.length > 0) { completeName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName}`; shortName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName.charAt(0)}.`; } From a078262113ab6d5dbb1ea450cc06b5f9235054f9 Mon Sep 17 00:00:00 2001 From: Arne Gnisa Date: Fri, 22 Sep 2023 13:34:11 +0200 Subject: [PATCH 2/2] N21-1269 fix 2 --- controllers/oauth2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/oauth2.js b/controllers/oauth2.js index f5354e4b4d..3e0c6c9731 100644 --- a/controllers/oauth2.js +++ b/controllers/oauth2.js @@ -155,7 +155,7 @@ router.get('/username/:pseudonym', async (req, res, next) => { qs: { id: pseudonymResponse.userId }, $limit: 1, }); - if (userResponse.data?.length > 0) { + if (userResponse.data.length) { completeName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName}`; shortName = `${userResponse.data[0].firstName} ${userResponse.data[0].lastName.charAt(0)}.`; }