From b662b0742fb0603eba497124da034ab04dfce78d Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Tue, 13 Feb 2024 14:22:53 +0100 Subject: [PATCH] Merge pull request #17030 from overleaf/ab-fix-sso-enable-clearing-attributes [web] Fix SSO config update when enabling and block enabling unvalidated config GitOrigin-RevId: 27b043117d5599d327e2322acd3901fc7286ab6b --- .../test/acceptance/src/helpers/Subscription.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/web/test/acceptance/src/helpers/Subscription.js b/services/web/test/acceptance/src/helpers/Subscription.js index e656dba856..76544a07f6 100644 --- a/services/web/test/acceptance/src/helpers/Subscription.js +++ b/services/web/test/acceptance/src/helpers/Subscription.js @@ -91,6 +91,21 @@ class Subscription { ) } + setValidatedSSO(callback) { + db.subscriptions.findOne({ _id: new ObjectId(this._id) }, (error, doc) => { + if (error) { + return callback(error) + } + const ssoConfigId = doc.ssoConfig + + db.ssoConfigs.findOneAndUpdate( + { _id: ssoConfigId }, + { $set: { validated: true } }, + callback + ) + }) + } + setValidatedAndEnabledSSO(callback) { db.subscriptions.findOne({ _id: new ObjectId(this._id) }, (error, doc) => { if (error) {