From 192e38cd673401d4d72f306167e3d563cbf430eb Mon Sep 17 00:00:00 2001
From: Aidan
Date: Tue, 8 Apr 2025 16:54:38 -0400
Subject: [PATCH] feat: allow registration disabling
---
app/account/login/page.tsx | 15 +-
app/account/signup/layout.tsx | 17 ++
app/api/users/create/route.ts | 307 ++++++++++++++++--------------
components/pages/main/Hero.tsx | 19 +-
components/pages/main/Pricing.tsx | 38 +++-
5 files changed, 231 insertions(+), 165 deletions(-)
create mode 100644 app/account/signup/layout.tsx
diff --git a/app/account/login/page.tsx b/app/account/login/page.tsx
index ee4b575..f779f8a 100644
--- a/app/account/login/page.tsx
+++ b/app/account/login/page.tsx
@@ -31,12 +31,19 @@ export default async function Login() {
Sign in with Authentik
-
-
-
-
- Get started
-
+ {process.env.SIGNUP_ENABLED === "true" ? (
+
+
+ Get Started
+
+
+
+ ) : (
+
+
+ Registration Closed
-
+ )}
diff --git a/components/pages/main/Pricing.tsx b/components/pages/main/Pricing.tsx
index 73e16c5..9d26bb3 100644
--- a/components/pages/main/Pricing.tsx
+++ b/components/pages/main/Pricing.tsx
@@ -1,7 +1,7 @@
"use client"
import type React from "react"
-import { Check, ChevronRight, Clock } from "lucide-react"
+import { Check, ChevronRight, Clock, XCircle } from "lucide-react"
import { Separator } from "@/components/ui/separator"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
@@ -145,6 +145,21 @@ const PricingCard: React.FC = ({
)}
+ {title !== "Everything" ? (
+
+ Starting at
+
+ ) : (
+
+ Always
+
+ )}
= ({
{isComingSoon ? (
- Coming Soon
+ Coming Soon
) : buttonText ? (
-
-
- {buttonText}
- {buttonIcon}
+ process.env.SIGNUP_ENABLED === "true" ? (
+
+
+ {buttonText}
+ {buttonIcon}
+
+
+ ) : (
+
+
+ Registration Closed
-
+ )
) : null}
@@ -215,7 +237,7 @@ export default function Pricing(): React.ReactElement {
features={features.everything}
badge="Most Popular"
buttonText="Get Started"
- buttonIcon={}
+ buttonIcon={}
/>