mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #2337 from overleaf/jel-saml-already-linked
Institution linking and unlinking GitOrigin-RevId: 1c3665fc66513c3e88a62ed477800c17759459ff
This commit is contained in:
committed by
sharelatex
parent
3bd15b1a47
commit
b5d7887dfb
@@ -497,7 +497,7 @@ const ProjectController = {
|
||||
// Notification: After SSO Linked or Logging in
|
||||
// The requested email does not match primary email returned from
|
||||
// the institution
|
||||
if (samlSession.emailNonCanonical) {
|
||||
if (samlSession.emailNonCanonical && !samlSession.linkedToAnother) {
|
||||
notificationsInstitution.push({
|
||||
institutionEmail: samlSession.emailNonCanonical,
|
||||
requestedEmail: samlSession.requestedEmail,
|
||||
@@ -509,12 +509,23 @@ const ProjectController = {
|
||||
// registerIntercept is set before the institution callback.
|
||||
// institutionEmail is set after institution callback.
|
||||
// Check for both in case SSO flow was abandoned
|
||||
if (samlSession.registerIntercept && samlSession.institutionEmail) {
|
||||
if (
|
||||
samlSession.registerIntercept &&
|
||||
samlSession.institutionEmail &&
|
||||
!samlSession.linkedToAnother
|
||||
) {
|
||||
notificationsInstitution.push({
|
||||
email: samlSession.institutionEmail,
|
||||
templateKey: 'notification_institution_sso_already_registered'
|
||||
})
|
||||
}
|
||||
|
||||
// Notification: Already linked to another account
|
||||
if (samlSession.linkedToAnother) {
|
||||
notificationsInstitution.push({
|
||||
templateKey: 'notification_institution_sso_linked_by_another'
|
||||
})
|
||||
}
|
||||
}
|
||||
delete req.session.saml
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user