mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-15 17:37:38 +00:00
Merge pull request #3631 from overleaf/jel-sso-link-set-reconfirmed
Set reconfirmedAt when linking a confirmed email GitOrigin-RevId: 7b3fb0638d13a777900e1e0962712816277da4aa
This commit is contained in:
parent
b35114b81a
commit
e83f16422a
1 changed files with 1 additions and 2 deletions
|
@ -119,11 +119,9 @@ async function _addInstitutionEmail(userId, email, providerId, auditLog) {
|
|||
if (emailAlreadyAssociated && emailAlreadyAssociated.confirmedAt) {
|
||||
await UserUpdater.promises.updateUser(query, update)
|
||||
} else if (emailAlreadyAssociated) {
|
||||
await UserUpdater.promises.confirmEmail(user._id, email)
|
||||
await UserUpdater.promises.updateUser(query, update)
|
||||
} else {
|
||||
await UserUpdater.promises.addEmailAddress(user._id, email, {}, auditLog)
|
||||
await UserUpdater.promises.confirmEmail(user._id, email)
|
||||
await UserUpdater.promises.updateUser(query, update)
|
||||
}
|
||||
}
|
||||
|
@ -212,6 +210,7 @@ async function linkAccounts(
|
|||
auditLog
|
||||
)
|
||||
await _addInstitutionEmail(userId, institutionEmail, providerId, auditLog)
|
||||
await UserUpdater.promises.confirmEmail(userId, institutionEmail) // will set confirmedAt if not set, and will always update reconfirmedAt
|
||||
await _sendLinkedEmail(userId, providerName, institutionEmail)
|
||||
// update v1 affiliations record
|
||||
if (hasEntitlement) {
|
||||
|
|
Loading…
Add table
Reference in a new issue