feat: implement configuration management and enhance user registration flow
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user