feat: implement configuration management and enhance user registration flow

This commit is contained in:
2026-03-11 22:26:16 +01:00
parent 62549faffa
commit 0f1b9c11fe
12 changed files with 370 additions and 95 deletions

View File

@@ -3,11 +3,13 @@
import Link from "next/link";
import { useState } from "react";
import { useLogin } from "@/hooks/use-auth";
import { useConfig } from "@/hooks/use-channels";
export default function LoginPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const { mutate: login, isPending, error } = useLogin();
const { data: config } = useConfig();
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
@@ -63,12 +65,14 @@ export default function LoginPage() {
</button>
</form>
<p className="text-center text-xs text-zinc-500">
No account?{" "}
<Link href="/register" className="text-zinc-300 hover:text-white">
Create one
</Link>
</p>
{config?.allow_registration !== false && (
<p className="text-center text-xs text-zinc-500">
No account?{" "}
<Link href="/register" className="text-zinc-300 hover:text-white">
Create one
</Link>
</p>
)}
</div>
);
}