Merge pull request #19863 from overleaf/jpa-log-noise-pro

[web] gracefully handle missing "getUserGroupsSSOEnrollmentStatus" hook

GitOrigin-RevId: 3e37a9caf4ccc54ec89c9a274bd4a55c503a3f43
This commit is contained in:
Jakob Ackermann 2024-08-21 13:28:11 +02:00 committed by Copybot
parent d5643d53b3
commit de842c61c3

View file

@ -115,14 +115,15 @@ async function settingsPage(req, res) {
let memberOfSSOEnabledGroups = [] let memberOfSSOEnabledGroups = []
try { try {
memberOfSSOEnabledGroups = ( memberOfSSOEnabledGroups =
(
await Modules.promises.hooks.fire( await Modules.promises.hooks.fire(
'getUserGroupsSSOEnrollmentStatus', 'getUserGroupsSSOEnrollmentStatus',
user._id, user._id,
{ teamName: 1 }, { teamName: 1 },
['email'] ['email']
) )
)?.[0] )?.[0] || []
memberOfSSOEnabledGroups = memberOfSSOEnabledGroups.map(group => { memberOfSSOEnabledGroups = memberOfSSOEnabledGroups.map(group => {
return { return {
groupId: group._id.toString(), groupId: group._id.toString(),