Translate login authentication errors

This commit is contained in:
n200534
2026-08-18 15:33:42 +05:30
parent 87e681b71e
commit eff8bb16a0
33 changed files with 177 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ import { Anchor, Box, Button, Center, Container, Group, Paper, PasswordInput, St
import { useForm } from "@mantine/form"
import { useAsyncCallback } from "react-async-hook"
import { Link } from "react-router-dom"
import { client, errorToStrings } from "@/app/client"
import { client, loginErrorToStrings } from "@/app/client"
import { redirectToRootCategory } from "@/app/redirect/thunks"
import { useAppDispatch, useAppSelector } from "@/app/store"
import type { LoginRequest } from "@/app/types"
@@ -39,7 +39,7 @@ export function LoginPage() {
</Title>
{login.error && (
<Box mb="md">
<Alert messages={errorToStrings(login.error)} />
<Alert messages={loginErrorToStrings(login.error, _(msg`Wrong username or password`))} />
</Box>
)}
<form onSubmit={form.onSubmit(login.execute)}>