From de842c61c391ccfec7e889bb4aedb71db7dda55e Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 21 Aug 2024 13:28:11 +0200 Subject: [PATCH] Merge pull request #19863 from overleaf/jpa-log-noise-pro [web] gracefully handle missing "getUserGroupsSSOEnrollmentStatus" hook GitOrigin-RevId: 3e37a9caf4ccc54ec89c9a274bd4a55c503a3f43 --- .../src/Features/User/UserPagesController.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/services/web/app/src/Features/User/UserPagesController.js b/services/web/app/src/Features/User/UserPagesController.js index d5f106cf4e..78cd7e8f56 100644 --- a/services/web/app/src/Features/User/UserPagesController.js +++ b/services/web/app/src/Features/User/UserPagesController.js @@ -115,14 +115,15 @@ async function settingsPage(req, res) { let memberOfSSOEnabledGroups = [] try { - memberOfSSOEnabledGroups = ( - await Modules.promises.hooks.fire( - 'getUserGroupsSSOEnrollmentStatus', - user._id, - { teamName: 1 }, - ['email'] - ) - )?.[0] + memberOfSSOEnabledGroups = + ( + await Modules.promises.hooks.fire( + 'getUserGroupsSSOEnrollmentStatus', + user._id, + { teamName: 1 }, + ['email'] + ) + )?.[0] || [] memberOfSSOEnabledGroups = memberOfSSOEnabledGroups.map(group => { return { groupId: group._id.toString(),