Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🔒️ Check feature flag when accessing api keys
Luke Vellafab30db0c732
diff --git a/apps/web/src/app/[locale]/(space)/settings/api-keys/page.tsx b/apps/web/src/app/[locale]/(space)/settings/api-keys/page.tsxindex 5f2b6b671..249c651ae 100644--- a/apps/web/src/app/[locale]/(space)/settings/api-keys/page.tsx+++ b/apps/web/src/app/[locale]/(space)/settings/api-keys/page.tsx@@ -15,18 +15,35 @@ import {} from "@/app/components/settings-layout";import { requireSpace, requireUser } from "@/auth/data";import { Trans } from "@/components/trans";+import { PostHogClient } from "@/features/analytics/posthog";import { getTranslation } from "@/i18n/server";import { createSSRHelper } from "@/trpc/server/create-ssr-helper";+import { isSelfHosted } from "@/utils/constants";import { ApiKeysList } from "./components/api-keys-list";import { CreateApiKeyButton } from "./components/create-api-key-button";export default async function ApiKeysSettingsPage() {+ if (isSelfHosted) {+ return notFound();+ }++ const posthog = PostHogClient();+const [space, user] = await Promise.all([requireSpace(), requireUser()]);if (space.ownerId !== user.id) {return notFound();}+ const isFeatureFlagEnabled = await posthog?.isFeatureEnabled(+ "developer-tools",+ user.id,+ );++ if (!isFeatureFlagEnabled) {+ return notFound();+ }+const helpers = await createSSRHelper();await helpers.apiKeys.list.prefetch();