mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 09:24:56 +02:00
Fix initialize openid auth strategy
This commit is contained in:
parent
e07d17c472
commit
89eb857c14
3 changed files with 24 additions and 14 deletions
|
@ -133,15 +133,7 @@ class ServerSettings {
|
|||
|
||||
// remove uninitialized methods
|
||||
// OpenID
|
||||
if (this.authActiveAuthMethods.includes('openid') && (
|
||||
!this.authOpenIDIssuerURL ||
|
||||
!this.authOpenIDAuthorizationURL ||
|
||||
!this.authOpenIDTokenURL ||
|
||||
!this.authOpenIDUserInfoURL ||
|
||||
!this.authOpenIDJwksURL ||
|
||||
!this.authOpenIDClientID ||
|
||||
!this.authOpenIDClientSecret
|
||||
)) {
|
||||
if (this.authActiveAuthMethods.includes('openid') && !this.isOpenIDAuthSettingsValid) {
|
||||
this.authActiveAuthMethods.splice(this.authActiveAuthMethods.indexOf('openid', 0), 1)
|
||||
}
|
||||
|
||||
|
@ -235,6 +227,19 @@ class ServerSettings {
|
|||
return ['local', 'openid']
|
||||
}
|
||||
|
||||
/**
|
||||
* Auth settings required for openid to be valid
|
||||
*/
|
||||
get isOpenIDAuthSettingsValid() {
|
||||
return this.authOpenIDIssuerURL &&
|
||||
this.authOpenIDAuthorizationURL &&
|
||||
this.authOpenIDTokenURL &&
|
||||
this.authOpenIDUserInfoURL &&
|
||||
this.authOpenIDJwksURL &&
|
||||
this.authOpenIDClientID &&
|
||||
this.authOpenIDClientSecret
|
||||
}
|
||||
|
||||
get authenticationSettings() {
|
||||
return {
|
||||
authActiveAuthMethods: this.authActiveAuthMethods,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue