Discord sign-in makes a basic account (Discord's verified email, no username or password) for T5DE's other sites; it finishes setting up with a username and password to use the hub. Implicit linking by email is off; members link Discord from their account page. Better Auth 1.7.26.
32 lines
1.4 KiB
TypeScript
32 lines
1.4 KiB
TypeScript
"use client";
|
|
// A basic account (made by signing in with Discord) chooses a username and password, and becomes a member.
|
|
import { ActionForm, SubmitButton } from "@/components/forms";
|
|
import { Field, FieldDescription, FieldGroup, FieldLabel } from "@/components/ui/field";
|
|
import { Input } from "@/components/ui/input";
|
|
import { finishSetup } from "./actions";
|
|
|
|
export function FinishSetupForm() {
|
|
return (
|
|
<ActionForm action={finishSetup}>
|
|
<FieldGroup>
|
|
<Field>
|
|
<FieldLabel htmlFor="username">Username</FieldLabel>
|
|
<Input id="username" name="username" autoComplete="username" required minLength={3} maxLength={32} pattern="[A-Za-z0-9_]+" autoFocus />
|
|
<FieldDescription>Letters, digits and underscores. Other T5DE members see it.</FieldDescription>
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="password">Password</FieldLabel>
|
|
<Input id="password" name="password" type="password" autoComplete="new-password" required minLength={10} maxLength={256} />
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="password2">Password again</FieldLabel>
|
|
<Input id="password2" name="password2" type="password" autoComplete="new-password" required minLength={10} maxLength={256} />
|
|
</Field>
|
|
<Field>
|
|
<SubmitButton pendingLabel="Setting up…">Finish setting up</SubmitButton>
|
|
</Field>
|
|
</FieldGroup>
|
|
</ActionForm>
|
|
);
|
|
}
|