This commit is contained in:
Stavros
2025-01-23 19:16:35 +02:00
parent 143b13af2c
commit 80d25551e0
16 changed files with 491 additions and 115 deletions

View File

@@ -20,7 +20,7 @@ export const LoginPage = () => {
}
const schema = z.object({
username: z.string(),
email: z.string().email(),
password: z.string(),
});
@@ -29,7 +29,7 @@ export const LoginPage = () => {
const form = useForm({
mode: "uncontrolled",
initialValues: {
username: "",
email: "",
password: "",
},
validate: zodResolver(schema),
@@ -42,7 +42,7 @@ export const LoginPage = () => {
onError: () => {
notifications.show({
title: "Failed to login",
message: "Check your username and password",
message: "Check your email and password",
color: "red",
});
},
@@ -68,12 +68,12 @@ export const LoginPage = () => {
<Paper shadow="md" p={30} mt={30} radius="md" withBorder>
<form onSubmit={form.onSubmit(handleSubmit)}>
<TextInput
label="Username"
placeholder="tinyauth"
label="Email"
placeholder="user@example.com"
required
disabled={loginMutation.isLoading}
key={form.key("username")}
{...form.getInputProps("username")}
key={form.key("email")}
{...form.getInputProps("email")}
/>
<PasswordInput
label="Password"
@@ -90,7 +90,7 @@ export const LoginPage = () => {
type="submit"
loading={loginMutation.isLoading}
>
Sign in
Login
</Button>
</form>
</Paper>