Fix initialize openid auth strategy

This commit is contained in:
advplyr 2023-11-19 12:57:17 -06:00
parent e07d17c472
commit 89eb857c14
3 changed files with 24 additions and 14 deletions

View file

@ -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,