mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
fix(server): oidc registration (#12723)
This commit is contained in:
@@ -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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user