Merge pull request #15656 from overleaf/bg-group-sso-login-acceptance-tests

add acceptance tests for group sso login

GitOrigin-RevId: 046d142ab478e45619b3a76d88eac73a808dfa08
This commit is contained in:
Brian Gough 2023-11-21 11:03:14 +00:00 committed by Copybot
parent 3ff156ea29
commit 3e5273144e
3 changed files with 14 additions and 0 deletions

View file

@ -120,6 +120,8 @@ class SAMLInvalidSignatureError extends SAMLAuthenticationError {
}
}
class SAMLInvalidResponseError extends SAMLAuthenticationError {}
class SAMLLoginFailureError extends SAMLAuthenticationError {
get i18nKey() {
return 'saml_login_failure'
@ -259,6 +261,7 @@ module.exports = {
SAMLGroupSSOLoginIdentityNotFoundError,
SAMLGroupSSODisabledError,
SAMLInvalidSignatureError,
SAMLInvalidResponseError,
SAMLLoginFailureError,
SLInV2Error,
ThirdPartyIdentityExistsError,

View file

@ -24,6 +24,8 @@ class Subscription {
this.planCode = options.planCode
this.recurlySubscription_id = options.recurlySubscription_id
this.features = options.features
this.ssoConfig = options.ssoConfig
this.groupPolicy = options.groupPolicy
}
ensureExists(callback) {

View file

@ -40,6 +40,7 @@ class User {
this._id = user._id.toString()
this.first_name = user.first_name
this.referal_id = user.referal_id
this.enrollment = user.enrollment
}
get(callback) {
@ -228,6 +229,14 @@ class User {
UserModel.updateOne({ _id: this.id }, { emails }, callback)
}
setEnrollment(enrollment, callback) {
UserModel.updateOne({ _id: this.id }, { enrollment }, callback)
}
setSamlIdentifiers(samlIdentifiers, callback) {
UserModel.updateOne({ _id: this.id }, { samlIdentifiers }, callback)
}
logout(callback) {
this.getCsrfToken(error => {
if (error != null) {