diff --git a/web/src/common/api/config.ts b/web/src/common/api/config.ts index 6276ec8a5..8de76d840 100644 --- a/web/src/common/api/config.ts +++ b/web/src/common/api/config.ts @@ -5,7 +5,6 @@ import { } from "@goauthentik/common/api/middleware"; import { EVENT_LOCALE_REQUEST, EVENT_REFRESH, VERSION } from "@goauthentik/common/constants"; import { globalAK } from "@goauthentik/common/global"; -import { customEvent } from "@goauthentik/elements/utils/customEvents"; import { Config, Configuration, CoreApi, CurrentTenant, RootApi } from "@goauthentik/api"; @@ -39,7 +38,13 @@ export function tenantSetLocale(tenant: CurrentTenant) { return; } console.debug("authentik/locale: setting locale from tenant default"); - window.dispatchEvent(customEvent(EVENT_LOCALE_REQUEST, { locale: tenant.defaultLocale })); + window.dispatchEvent( + new CustomEvent(EVENT_LOCALE_REQUEST, { + composed: true, + bubbles: true, + detail: { locale: tenant.defaultLocale }, + }), + ); } let globalTenantPromise: Promise | undefined = Promise.resolve(globalAK().tenant); diff --git a/web/src/common/users.ts b/web/src/common/users.ts index 02e269895..5378236ce 100644 --- a/web/src/common/users.ts +++ b/web/src/common/users.ts @@ -1,6 +1,5 @@ import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { EVENT_LOCALE_REQUEST } from "@goauthentik/common/constants"; -import { customEvent } from "@goauthentik/elements/utils/customEvents"; import { CoreApi, ResponseError, SessionUser } from "@goauthentik/api"; @@ -24,7 +23,13 @@ export function me(): Promise { console.debug( `authentik/locale: Activating user's configured locale '${locale}'`, ); - window.dispatchEvent(customEvent(EVENT_LOCALE_REQUEST, { locale })); + window.dispatchEvent( + new CustomEvent(EVENT_LOCALE_REQUEST, { + composed: true, + bubbles: true, + detail: { locale }, + }), + ); } return user; })