feat: feature flags

This commit is contained in:
David Nguyen
2023-08-18 20:05:14 +10:00
committed by Mythie
parent 64eefbd340
commit aa2969fd50
23 changed files with 663 additions and 36 deletions

View File

@ -1,15 +1,17 @@
import { redirect } from 'next/navigation';
import { IS_SUBSCRIPTIONS_ENABLED } from '@documenso/lib/constants/features';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { PasswordForm } from '~/components/forms/password';
import { getServerComponentFlag } from '~/helpers/get-server-component-feature-flag';
export default async function BillingSettingsPage() {
const user = await getRequiredServerComponentSession();
const isBillingEnabled = await getServerComponentFlag('billing');
// Redirect if subscriptions are not enabled.
if (!IS_SUBSCRIPTIONS_ENABLED) {
if (!isBillingEnabled) {
redirect('/settings/profile');
}