feat(csms): add setup routes and pages for initial user creation

This commit is contained in:
2026-03-10 21:40:27 +08:00
parent fc18332cd5
commit 4f9fbe13fd
6 changed files with 317 additions and 24 deletions

View File

@@ -1,13 +1,15 @@
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { useRouter, useSearchParams } from "next/navigation";
import { Alert, Button, Card, CloseButton, Input, Label, TextField } from "@heroui/react";
import { Thunderbolt } from "@gravity-ui/icons";
import { authClient } from "@/lib/auth-client";
export default function LoginPage() {
const router = useRouter();
const searchParams = useSearchParams();
const justSetup = searchParams.get("setup") === "1";
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
@@ -52,6 +54,15 @@ export default function LoginPage() {
<Card className="w-full max-w-sm">
<Card.Content>
<form onSubmit={handleSubmit} className="space-y-4">
{justSetup && (
<Alert status="success">
<Alert.Indicator />
<Alert.Content>
<Alert.Title></Alert.Title>
<Alert.Description></Alert.Description>
</Alert.Content>
</Alert>
)}
<TextField fullWidth>
<Label className="text-sm font-medium"></Label>
<Input