mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
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
This commit is contained in:
committed by
Copybot
parent
7c681dc88a
commit
b662b0742f
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user