Add environment variable to enable team creation for new users in self-hosted deployments (#74)
This commit is contained in:
@@ -4,6 +4,7 @@ import { useSession } from "next-auth/react";
|
||||
import { FullScreenLoading } from "~/components/FullScreenLoading";
|
||||
import { AddSesSettings } from "~/components/settings/AddSesSettings";
|
||||
import CreateTeam from "~/components/team/CreateTeam";
|
||||
import TeamCreationDisabled from "~/components/team/TeamCreationDisabled";
|
||||
import { env } from "~/env";
|
||||
import { api } from "~/trpc/react";
|
||||
|
||||
@@ -26,6 +27,14 @@ export const DashboardProvider = ({
|
||||
return <FullScreenLoading />;
|
||||
}
|
||||
|
||||
if (
|
||||
!env.NEXT_PUBLIC_IS_CLOUD &&
|
||||
!env.NEXT_PUBLIC_SELF_HOSTED_ALLOW_NEW_USERS &&
|
||||
(!teams || teams.length === 0)
|
||||
) {
|
||||
return <TeamCreationDisabled />;
|
||||
}
|
||||
|
||||
if (
|
||||
settings?.length === 0 &&
|
||||
(!env.NEXT_PUBLIC_IS_CLOUD || session?.user.isAdmin)
|
||||
|
Reference in New Issue
Block a user