Merge pull request #25011 from overleaf/jel-group-audit-logs-part-2

[web] Update group audit log when user enrolls in managed users

GitOrigin-RevId: 15d79854007ac3334a2bb66bcf73230bf42c68ce
This commit is contained in:
Jessica Lawshe
2025-05-27 09:38:53 -05:00
committed by Copybot
parent 93a1996491
commit 881db9b472
3 changed files with 10 additions and 4 deletions

View File

@@ -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)

View File

@@ -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) {

View File

@@ -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',
}
)
}