Login
-
- Register
-
+ {REGISTRATION_ENABLED && (
+
+ Register
+
+ )}
>
)}
@@ -136,13 +139,15 @@ export function Navbar() {
>
Login
- setMobileMenuOpen(false)}
- >
- Register
-
+ {REGISTRATION_ENABLED && (
+ setMobileMenuOpen(false)}
+ >
+ Register
+
+ )}
>
)}
diff --git a/frontend/src/config/registration.ts b/frontend/src/config/registration.ts
new file mode 100644
index 0000000..96a8c0c
--- /dev/null
+++ b/frontend/src/config/registration.ts
@@ -0,0 +1,5 @@
+// Inlined at build time by Vite via import.meta.env.
+// Unset (local dev / no build arg) → registration is enabled (backward compatible).
+// Set to "false" via docker build --build-arg REGISTRATION_ENABLED=false → registration disabled.
+export const REGISTRATION_ENABLED =
+ import.meta.env.VITE_REGISTRATION_ENABLED !== 'false';
\ No newline at end of file
diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx
index d87dc44..347ca48 100644
--- a/frontend/src/pages/Login.tsx
+++ b/frontend/src/pages/Login.tsx
@@ -3,6 +3,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { Link, useSearchParams } from 'react-router-dom';
import { useAuth } from '../hooks/useAuth';
+import { REGISTRATION_ENABLED } from '../config/registration';
const loginSchema = z.object({
email: z.string().min(1, 'Email is required').email('Invalid email address'),
@@ -81,12 +82,14 @@ export default function Login() {
-
- Don‘t have an account?
-
- Register
-
-
+ {REGISTRATION_ENABLED && (
+
+ Don‘t have an account?
+
+ Register
+
+
+ )}
);
}
diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts
new file mode 100644
index 0000000..151aa68
--- /dev/null
+++ b/frontend/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
\ No newline at end of file