mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-16 12:24:56 +02:00
Fixes for passport local and allow empty password
This commit is contained in:
parent
812395b21b
commit
7010a13648
10 changed files with 206 additions and 75 deletions
|
@ -1,5 +1,4 @@
|
|||
const { BookshelfView } = require('../../utils/constants')
|
||||
const { isNullOrNaN } = require('../../utils')
|
||||
const Logger = require('../../Logger')
|
||||
|
||||
class ServerSettings {
|
||||
|
@ -144,7 +143,7 @@ class ServerSettings {
|
|||
this.authGoogleOauth20ClientSecret === '' ||
|
||||
this.authGoogleOauth20CallbackURL === ''
|
||||
)) {
|
||||
this.authActiveAuthMethods.splice(this.authActiveAuthMethods.indexOf('google-oauth20', 0), 1);
|
||||
this.authActiveAuthMethods.splice(this.authActiveAuthMethods.indexOf('google-oauth20', 0), 1)
|
||||
}
|
||||
|
||||
// remove uninitialized methods
|
||||
|
@ -158,7 +157,7 @@ class ServerSettings {
|
|||
this.authOpenIDClientSecret === '' ||
|
||||
this.authOpenIDCallbackURL === ''
|
||||
)) {
|
||||
this.authActiveAuthMethods.splice(this.authActiveAuthMethods.indexOf('generic-oauth20', 0), 1);
|
||||
this.authActiveAuthMethods.splice(this.authActiveAuthMethods.indexOf('generic-oauth20', 0), 1)
|
||||
}
|
||||
|
||||
// fallback to local
|
||||
|
@ -241,10 +240,10 @@ class ServerSettings {
|
|||
}
|
||||
|
||||
update(payload) {
|
||||
var hasUpdates = false
|
||||
let hasUpdates = false
|
||||
for (const key in payload) {
|
||||
if (key === 'sortingPrefixes' && payload[key] && payload[key].length) {
|
||||
var prefixesCleaned = payload[key].filter(prefix => !!prefix).map(prefix => prefix.toLowerCase())
|
||||
const prefixesCleaned = payload[key].filter(prefix => !!prefix).map(prefix => prefix.toLowerCase())
|
||||
if (prefixesCleaned.join(',') !== this[key].join(',')) {
|
||||
this[key] = [...prefixesCleaned]
|
||||
hasUpdates = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue