mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-29 18:00:26 -06:00
28 lines
746 B
TypeScript
28 lines
746 B
TypeScript
import { getEnvironmentAuth } from "@/modules/environments/lib/utils";
|
|
import { Metadata } from "next";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Configuration",
|
|
};
|
|
|
|
export const ProjectSettingsLayout = async (props) => {
|
|
const params = await props.params;
|
|
const { children } = props;
|
|
|
|
try {
|
|
// Use the new utility to get all required data with authorization checks
|
|
const { isBilling } = await getEnvironmentAuth(params.environmentId);
|
|
|
|
// Redirect billing users
|
|
if (isBilling) {
|
|
return redirect(`/environments/${params.environmentId}/settings/billing`);
|
|
}
|
|
|
|
return children;
|
|
} catch (error) {
|
|
// The error boundary will catch this
|
|
throw error;
|
|
}
|
|
};
|