mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Merge pull request #16082 from overleaf/jel-group-sso-already-linked
[web] Fix projection when checking if user is already enrolled in SSO GitOrigin-RevId: eebe645cba2f911783f1b2a636a4fc51a8f6107b
This commit is contained in:
@@ -18,10 +18,7 @@ async function checkUserCanEnrollInSubscription(userId, subscription) {
|
||||
throw new Errors.SAMLGroupSSOLoginIdentityNotFoundError()
|
||||
}
|
||||
|
||||
const user = await User.findOne(
|
||||
{ _id: userId },
|
||||
{ projection: { enrollment: 1 } }
|
||||
).exec()
|
||||
const user = await User.findOne({ _id: userId }, { enrollment: 1 }).exec()
|
||||
|
||||
const userIsEnrolled = user.enrollment?.sso?.some(
|
||||
enrollment => enrollment.groupId.toString() === subscription._id.toString()
|
||||
|
||||
Reference in New Issue
Block a user