diff --git a/frontend/src/App.css b/frontend/src/App.css
index 3fc8113..ba3535a 100644
--- a/frontend/src/App.css
+++ b/frontend/src/App.css
@@ -1,7 +1,3 @@
#root {
height: 100%;
- box-shadow: 1px 1px 20px 1px rgba(68, 68, 68, 0.5);
- border-radius: 40px;
- border: 1px solid #444;
- overflow: hidden;
}
\ No newline at end of file
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 411f6b1..f1abb1b 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -2,12 +2,14 @@ import './App.css'
import { Route, Routes } from "react-router-dom";
import { LoginPage } from "./pages/LoginPage";
import { ForgotPasswordPage } from "./pages/ForgotPasswordPage";
+import { DashboardPage } from './pages/Dashboard';
function App() {
return (
} />
} />
+ } />
);
}
diff --git a/frontend/src/features/auth/components/AuthComponent.tsx b/frontend/src/features/auth/components/AuthComponent.tsx
index cfbd8f7..f36d79b 100644
--- a/frontend/src/features/auth/components/AuthComponent.tsx
+++ b/frontend/src/features/auth/components/AuthComponent.tsx
@@ -1,7 +1,8 @@
import { useState, type SubmitEvent, type ReactElement } from "react";
-import { Link } from "react-router-dom";
+import { Link, useNavigate } from "react-router-dom";
import styles from "./AuthComponent.module.css";
import { login } from "../../../api/LoginAPI/Auth";
+import { persistRememberMe } from "../../../utils/rememberMe";
export function Auth():ReactElement {
const [email, setEmail] = useState("");
@@ -9,6 +10,7 @@ export function Auth():ReactElement {
const [rememberMe, setRememberMe] = useState(false);
const [showPassword, setShowPassword] = useState(false);
const [errors, setErrors] = useState<{ email?: string; password?: string }>({});
+ const navigate = useNavigate();
const validateEmail = (value: string) => {
if (!value) return "Введите email";
@@ -26,12 +28,13 @@ export function Auth():ReactElement {
try {
await login(email, password);
- window.location.href = "http://localhost:8000/docs";
+ persistRememberMe(rememberMe);
+ navigate("/dashboard");
} catch (err) {
console.error(err);
setErrors({ password: "Неверный email или пароль" });
}
- };
+ };
return (
<>
diff --git a/frontend/src/layouts/AuthLayout.css b/frontend/src/layouts/AuthLayout.css
index 1cfbfec..60bdf9e 100644
--- a/frontend/src/layouts/AuthLayout.css
+++ b/frontend/src/layouts/AuthLayout.css
@@ -5,6 +5,9 @@
width: 100%;
overflow: hidden;
height: 100%;
+ box-shadow: 1px 1px 20px 1px rgba(68, 68, 68, 0.5);
+ border-radius: 40px;
+ border: 1px solid #444;
}
.left_side {
width: 60%;
diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx
new file mode 100644
index 0000000..ae80c62
--- /dev/null
+++ b/frontend/src/pages/Dashboard.tsx
@@ -0,0 +1,9 @@
+
+
+export function DashboardPage() {
+ return (
+ <>
+
+ >
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/utils/rememberMe.ts b/frontend/src/utils/rememberMe.ts
new file mode 100644
index 0000000..839b2d5
--- /dev/null
+++ b/frontend/src/utils/rememberMe.ts
@@ -0,0 +1,9 @@
+
+
+export function persistRememberMe(value:boolean):void {
+ if (value) {
+ localStorage.setItem("rememberMe", "True");
+ } else{
+ localStorage.removeItem("rememberMe");
+ }
+};
\ No newline at end of file