fix(server): oidc registration (#12723)

This commit is contained in:
liuyi
2025-06-05 09:16:21 +00:00
committed by GitHub
parent d6a26b8093
commit 71be1d424a
@@ -60,7 +60,7 @@ export class OIDCProvider extends OAuthProvider {
const validate = async () => { const validate = async () => {
this.#endpoints = null; this.#endpoints = null;
if (this.configured) { if (super.configured) {
const config = this.config as OAuthOIDCProviderConfig; const config = this.config as OAuthOIDCProviderConfig;
try { try {
const res = await fetch( const res = await fetch(
@@ -73,7 +73,6 @@ export class OIDCProvider extends OAuthProvider {
if (res.ok) { if (res.ok) {
this.#endpoints = OIDCConfigurationSchema.parse(await res.json()); this.#endpoints = OIDCConfigurationSchema.parse(await res.json());
super.setup();
} else { } else {
this.logger.error(`Invalid OIDC issuer ${config.issuer}`); this.logger.error(`Invalid OIDC issuer ${config.issuer}`);
} }
@@ -81,6 +80,8 @@ export class OIDCProvider extends OAuthProvider {
this.logger.error('Failed to validate OIDC configuration', e); this.logger.error('Failed to validate OIDC configuration', e);
} }
} }
super.setup();
}; };
validate().catch(() => { validate().catch(() => {