mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-16 04:14:58 +02:00
Update:JWT signing
This commit is contained in:
parent
86ee4dcff2
commit
9e7b84f289
9 changed files with 76 additions and 24 deletions
|
@ -5,6 +5,7 @@ const Logger = require('../../Logger')
|
|||
class ServerSettings {
|
||||
constructor(settings) {
|
||||
this.id = 'server-settings'
|
||||
this.tokenSecret = null
|
||||
|
||||
// Scanner
|
||||
this.scannerParseSubtitle = false
|
||||
|
@ -63,6 +64,7 @@ class ServerSettings {
|
|||
}
|
||||
|
||||
construct(settings) {
|
||||
this.tokenSecret = settings.tokenSecret
|
||||
this.scannerFindCovers = !!settings.scannerFindCovers
|
||||
this.scannerCoverProvider = settings.scannerCoverProvider || 'google'
|
||||
this.scannerParseSubtitle = settings.scannerParseSubtitle
|
||||
|
@ -110,9 +112,10 @@ class ServerSettings {
|
|||
}
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
toJSON() { // Use toJSONForBrowser if sending to client
|
||||
return {
|
||||
id: this.id,
|
||||
tokenSecret: this.tokenSecret, // Do not return to client
|
||||
scannerFindCovers: this.scannerFindCovers,
|
||||
scannerCoverProvider: this.scannerCoverProvider,
|
||||
scannerParseSubtitle: this.scannerParseSubtitle,
|
||||
|
@ -145,6 +148,12 @@ class ServerSettings {
|
|||
}
|
||||
}
|
||||
|
||||
toJSONForBrowser() {
|
||||
const json = this.toJSON()
|
||||
delete json.tokenSecret
|
||||
return json
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
var hasUpdates = false
|
||||
for (const key in payload) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue