diff --git a/services/web/app/src/Features/Subscription/TeamInvitesController.mjs b/services/web/app/src/Features/Subscription/TeamInvitesController.mjs index ca508755e6..2da67c3010 100644 --- a/services/web/app/src/Features/Subscription/TeamInvitesController.mjs +++ b/services/web/app/src/Features/Subscription/TeamInvitesController.mjs @@ -197,7 +197,8 @@ async function acceptInvite(req, res, next) { const subscription = await TeamInvitesHandler.promises.acceptInvite( token, - userId + userId, + { initiatorId: userId, ipAddress: req.ip } ) const groupSSOActive = ( await Modules.promises.hooks.fire('hasGroupSSOEnabled', subscription) diff --git a/services/web/app/src/Features/Subscription/TeamInvitesHandler.js b/services/web/app/src/Features/Subscription/TeamInvitesHandler.js index 45a0495353..7312266ddf 100644 --- a/services/web/app/src/Features/Subscription/TeamInvitesHandler.js +++ b/services/web/app/src/Features/Subscription/TeamInvitesHandler.js @@ -64,7 +64,7 @@ async function importInvite(subscription, inviterName, email, token, sentAt) { return subscription.save() } -async function acceptInvite(token, userId) { +async function acceptInvite(token, userId, auditLog) { const { invite, subscription } = await getInvite(token) if (!invite) { throw new Errors.NotFoundError('invite not found') @@ -76,7 +76,8 @@ async function acceptInvite(token, userId) { await Modules.promises.hooks.fire( 'enrollInManagedSubscription', userId, - subscription + subscription, + auditLog ) } if (subscription.ssoConfig) { diff --git a/services/web/test/acceptance/src/helpers/Subscription.mjs b/services/web/test/acceptance/src/helpers/Subscription.mjs index db5c9c5898..a9adc113ae 100644 --- a/services/web/test/acceptance/src/helpers/Subscription.mjs +++ b/services/web/test/acceptance/src/helpers/Subscription.mjs @@ -126,7 +126,11 @@ class PromisifiedSubscription { return await Modules.promises.hooks.fire( 'enrollInManagedSubscription', user._id, - subscription + subscription, + { + initiatorId: user._id, + ipAddress: '0:0:0:0', + } ) }