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,27 @@
import Link from "next/link";
import { useState } from "react";
import { useRegister } from "@/hooks/use-auth";
import { useConfig } from "@/hooks/use-channels";
export default function RegisterPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const { mutate: register, isPending, error } = useRegister();
const { data: config } = useConfig();
if (config && !config.allow_registration) {
return (
<div className="w-full max-w-sm space-y-4 text-center">
<h1 className="text-xl font-semibold text-zinc-100">Registration disabled</h1>
<p className="text-sm text-zinc-500">
The administrator has disabled new account registration.
</p>
<Link href="/login" className="inline-block text-sm text-zinc-300 hover:text-white">
Sign in instead
</Link>
</div>
);
}
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();