GitOrigin-RevId: 15a0371c285256b871a9c3e393077af1371d1e5c
This commit is contained in:
Ersun Warncke 2019-10-22 08:29:27 -04:00 committed by sharelatex
parent 432f4d3a06
commit 9902edcfbb

View file

@ -53,10 +53,6 @@ async function _addIdentifier(
const updatedUser = User.findOneAndUpdate(query, update, {
new: true
}).exec()
// update v1 affiliations record
if (hasEntitlement) {
await InstitutionsAPI.promises.addEntitlement(userId, institutionEmail)
}
return updatedUser
} catch (err) {
if (err.code === 11000) {
@ -173,6 +169,10 @@ async function linkAccounts(
)
await _addInstitutionEmail(userId, institutionEmail, providerId)
await _sendLinkedEmail(userId, providerName)
// update v1 affiliations record
if (hasEntitlement) {
await InstitutionsAPI.promises.addEntitlement(userId, institutionEmail)
}
}
async function unlinkAccounts(