mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 09:18:22 +02:00
Fix initialize openid auth strategy
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user