From 3da7fcfc1d5167420d071e3dc4530c01f17248dd Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 24 Oct 2022 21:54:14 +0200 Subject: [PATCH] web/common: disable API Drawer by default in user interface Signed-off-by: Jens Langhammer --- web/src/common/sentry.ts | 2 +- web/src/common/ui/config.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/common/sentry.ts b/web/src/common/sentry.ts index 175c1a958..0884fdde6 100644 --- a/web/src/common/sentry.ts +++ b/web/src/common/sentry.ts @@ -80,5 +80,5 @@ export function currentInterface(): string { if (pathMatches && pathMatches.length >= 2) { currentInterface = pathMatches[1]; } - return currentInterface; + return currentInterface.toLowerCase(); } diff --git a/web/src/common/ui/config.ts b/web/src/common/ui/config.ts index 73067867a..ae27d31eb 100644 --- a/web/src/common/ui/config.ts +++ b/web/src/common/ui/config.ts @@ -1,3 +1,4 @@ +import { currentInterface } from "@goauthentik/common/sentry"; import { me } from "@goauthentik/common/users"; import { UserSelf } from "@goauthentik/api"; @@ -65,6 +66,12 @@ export class DefaultUIConfig implements UIConfig { perPage: 20, }; locale = ""; + + constructor() { + if (currentInterface() === "user") { + this.enabledFeatures.apiDrawer = false; + } + } } let globalUiConfig: Promise;