Merge pull request #2663 from overleaf/jel-sso-missing-email-error

Institution SSO error handling when missing session data

GitOrigin-RevId: c455ef97eb17b98ffbd03eb5f623ceb27678deed
This commit is contained in:
Jessica Lawshe
2020-03-12 04:18:52 +00:00
committed by Copybot
parent a433235310
commit 30763043d1
7 changed files with 84 additions and 3 deletions
@@ -354,6 +354,7 @@ const ProjectController = {
const userId = AuthenticationController.getLoggedInUserId(req)
const currentUser = AuthenticationController.getSessionUser(req)
let noV1Connection = false
let institutionLinkingError
async.parallel(
{
tags(cb) {
@@ -515,6 +516,16 @@ const ProjectController = {
templateKey: 'notification_institution_sso_linked_by_another'
})
}
// Notification: When there is a session error
if (samlSession.error) {
institutionLinkingError = samlSession.error
notificationsInstitution.push({
message: samlSession.error.message,
templateKey: 'notification_institution_sso_error',
tryAgain: samlSession.error.tryAgain
})
}
}
delete req.session.saml
}
@@ -551,6 +562,7 @@ const ProjectController = {
user,
userAffiliations,
hasSubscription: results.hasSubscription,
institutionLinkingError,
isShowingV1Projects:
results.v1Projects != null &&
results.v1Projects.projects.length > 0,