mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 07:33:36 -05: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:
parent
7c681dc88a
commit
b662b0742f
1 changed files with 15 additions and 0 deletions
|
@ -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) {
|
setValidatedAndEnabledSSO(callback) {
|
||||||
db.subscriptions.findOne({ _id: new ObjectId(this._id) }, (error, doc) => {
|
db.subscriptions.findOne({ _id: new ObjectId(this._id) }, (error, doc) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
Loading…
Reference in a new issue