mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
cleanup
This commit is contained in:
parent
3cd09eecba
commit
b77f7f2514
2 changed files with 0 additions and 22 deletions
|
|
@ -28,7 +28,6 @@ class SSOSettings {
|
|||
this.id = 'sso-settings'
|
||||
this.user = { ...settings.user }
|
||||
this.initOIDCSettings(settings);
|
||||
Logger.debug("[SSOSettings.constructor]", this.toJSON)
|
||||
}
|
||||
|
||||
initOIDCSettings(settings) {
|
||||
|
|
@ -75,31 +74,12 @@ class SSOSettings {
|
|||
const oldTmp = JSON.stringify(this.toJSON())
|
||||
const newTmp = JSON.stringify(payload) // deep copy "for free"
|
||||
const hasUpdates = difference(oldTmp, newTmp) !== ""; // Not very efficient, but ok for small objects
|
||||
Logger.debug(`SSOSettings hasUpdates=${hasUpdates}`)
|
||||
if (!hasUpdates) return hasUpdates
|
||||
|
||||
payload = JSON.parse(newTmp)
|
||||
this.oidc = payload.oidc
|
||||
this.user = payload.user
|
||||
return hasUpdates
|
||||
Logger.debug("SSOSettings.update", payload, this)
|
||||
for (const key in payload) {
|
||||
Logger.debug(`key: ${key}: ${JSON.stringify(payload[key])}`)
|
||||
if (isObject(payload[key])) {
|
||||
for (const setting in payload[key]) {
|
||||
if (!this[key] || this[key][setting] === payload[key][setting]) {
|
||||
continue
|
||||
}
|
||||
this[key][setting] = payload[key][setting]
|
||||
hasUpdates = true
|
||||
}
|
||||
} else if (this[key] !== undefined && this[key] !== payload[key]) {
|
||||
this[key] = payload[key]
|
||||
hasUpdates = true
|
||||
}
|
||||
}
|
||||
Logger.debug("SSOSettings.update", hasUpdates, this)
|
||||
return hasUpdates
|
||||
}
|
||||
|
||||
getNewUserPermissions() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue