diff --git a/app/account/signup/layout.tsx b/app/account/signup/layout.tsx
index b0177de..1577c11 100644
--- a/app/account/signup/layout.tsx
+++ b/app/account/signup/layout.tsx
@@ -5,13 +5,13 @@ export default function SignupLayout({
}: {
children: React.ReactNode
}) {
- if (process.env.SIGNUP_ENABLED === "false") {
+ if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "false") {
return
Signup is disabled
- } else if (process.env.SIGNUP_ENABLED === "true") {
+ } else if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "true") {
return (
{children}
)
} else {
- return Invalid SIGNUP_ENABLED environment variable
+ return Invalid NEXT_PUBLIC_SIGNUP_ENABLED environment variable
}
}
\ No newline at end of file
diff --git a/app/api/users/create/route.ts b/app/api/users/create/route.ts
index e02096d..3a8104b 100644
--- a/app/api/users/create/route.ts
+++ b/app/api/users/create/route.ts
@@ -8,9 +8,9 @@ import { validateToken } from "@/lib/utils"
async function createEmail(email: string, password: string, migrate: boolean) {
// Signup status check
- if (process.env.SIGNUP_ENABLED === "false") {
+ if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "false") {
return { success: false, message: "Signups are disabled" }
- } else if (process.env.SIGNUP_ENABLED === "true") {
+ } else if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "true") {
try {
if (!process.env.MAIL_CONNECT_API_URL) {
console.error("[!] Missing MAIL_CONNECT_API_URL environment variable")
@@ -49,7 +49,7 @@ async function createEmail(email: string, password: string, migrate: boolean) {
}
export async function POST(request: Request) {
- if (process.env.SIGNUP_ENABLED === "true") {
+ if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "true") {
try {
const body = await request.json()
const { name, email, password, migrate, token } = body
@@ -176,7 +176,7 @@ export async function POST(request: Request) {
console.error("[!] Unhandled error while creating user:", error)
return NextResponse.json({ success: false, message: "An unexpected error occurred" }, { status: 500 })
}
- } else if (process.env.SIGNUP_ENABLED === "false") {
+ } else if (process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "false") {
return NextResponse.json({ success: false, message: "Signups are disabled" }, { status: 403 })
} else {
return NextResponse.json({ success: false, message: "Account signup is not configured in your environment variables!" }, { status: 500 })
diff --git a/components/pages/main/Hero.tsx b/components/pages/main/Hero.tsx
index 7254af0..9a10857 100644
--- a/components/pages/main/Hero.tsx
+++ b/components/pages/main/Hero.tsx
@@ -23,9 +23,9 @@ const Hero = () => {
- {process.env.SIGNUP_ENABLED === "true" ? (
+ {process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "true" ? (
-
) : buttonText ? (
- process.env.SIGNUP_ENABLED === "true" ? (
+ process.env.NEXT_PUBLIC_SIGNUP_ENABLED === "true" ? (
-
+
{buttonText}
{buttonIcon}
diff --git a/docs/reference/env.md b/docs/reference/env.md
index 1a7f561..a9dd18c 100644
--- a/docs/reference/env.md
+++ b/docs/reference/env.md
@@ -11,7 +11,7 @@ With these variables, you can disable entire parts of the dashboard, such as reg
| Environment Variable | Description | Expected Value |
|----------------------------------|-----------------------------------------------------------|----------------------------------------|
-| SIGNUP_ENABLED | Controls if the signup page and APIs are enabled/disabled | `true` (Enabled) or `false` (Disabled) |
+| NEXT_PUBLIC_SIGNUP_ENABLED | Controls if the signup page and APIs are enabled/disabled | `true` (Enabled) or `false` (Disabled) |
| NEXT_PUBLIC_DONATE_URL | Changes the universal donation link for buttons/links | String - `https://...` |
| NEXT_PUBLIC_SUPPORT_EMAIL | Email displayed in the "Support" tab of dashboard | String - `example@example.com` |
| NEXT_PUBLIC_TELEGRAM_CHANNEL_URL | Changes the default Telegram channel link in Support dash | String - `https://t.me/...` |