feat: add authorization

This commit is contained in:
2026-08-13 15:03:59 +03:00
parent 1e13adabd3
commit 3448fea140
28 changed files with 4504 additions and 3707 deletions
+10 -5
View File
@@ -1,14 +1,19 @@
import { Stack, Title } from "@mantine/core";
import { Paper, Stack, Title } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { LoginForm } from "../../../features/auth";
import { StateView } from "../../../shared/ui/StateView";
export function LoginPage() {
const { t } = useTranslation();
return (
<Stack>
<Title order={1}>{t("auth.login")}</Title>
<LoginPageEmpty />
</Stack>
<main className="auth-page">
<Paper className="auth-card" p="xl" radius="lg" withBorder>
<Stack gap="lg">
<Title order={1}>{t("auth.login")}</Title>
<LoginForm />
</Stack>
</Paper>
</main>
);
}
+10 -5
View File
@@ -1,14 +1,19 @@
import { Stack, Title } from "@mantine/core";
import { Paper, Stack, Title } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { RegisterForm } from "../../../features/auth";
import { StateView } from "../../../shared/ui/StateView";
export function RegisterPage() {
const { t } = useTranslation();
return (
<Stack>
<Title order={1}>{t("auth.register")}</Title>
<RegisterPageEmpty />
</Stack>
<main className="auth-page">
<Paper className="auth-card" p="xl" radius="lg" withBorder>
<Stack gap="lg">
<Title order={1}>{t("auth.register")}</Title>
<RegisterForm />
</Stack>
</Paper>
</main>
);
}
+13 -2
View File
@@ -1,13 +1,24 @@
import { Stack, Title } from "@mantine/core";
import { Button, Stack, Title } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router";
import { useAuth } from "../../../features/auth";
import { StateView } from "../../../shared/ui/StateView";
export function SettingsPage() {
const { t } = useTranslation();
const { logout } = useAuth();
const navigate = useNavigate();
return (
<Stack>
<Title order={1}>{t("settings.title")}</Title>
<SettingsPageEmpty />
<Button
onClick={async () => {
await logout();
navigate("/login", { replace: true });
}}
>
{t("auth.logout")}
</Button>
</Stack>
);
}