Merge pull request #26050 from overleaf/em-saml-user-query
Improve index usage for SAML user query GitOrigin-RevId: 189aba60a12c8369a0062e7df4c57bef8a16c98c
This commit is contained in:
@@ -210,9 +210,13 @@ async function getUser(providerId, externalUserId, userIdAttribute) {
|
||||
)
|
||||
}
|
||||
const user = await User.findOne({
|
||||
'samlIdentifiers.externalUserId': externalUserId.toString(),
|
||||
'samlIdentifiers.providerId': providerId.toString(),
|
||||
'samlIdentifiers.userIdAttribute': userIdAttribute.toString(),
|
||||
samlIdentifiers: {
|
||||
$elemMatch: {
|
||||
externalUserId: externalUserId.toString(),
|
||||
providerId: providerId.toString(),
|
||||
userIdAttribute: userIdAttribute.toString(),
|
||||
},
|
||||
},
|
||||
}).exec()
|
||||
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user