diff --git a/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx b/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx index 0b95763..cb528a6 100644 --- a/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx +++ b/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { useNavigate } from "react-router-dom"; import { ButtonUi, ButtonUiType } from "../../../../shared/UI/ButtonUi"; @@ -15,8 +14,6 @@ import styles from "./authLoginForm.module.scss"; export const AuthLoginFormUi = () => { - const navigate = useNavigate(); - const schema = yup.object().shape({ username: yup.string() .min(3, 'Минимум 3 символа!') @@ -50,7 +47,7 @@ export const AuthLoginFormUi = () => { } else { setCookie('authToken', res.data!.authToken) setCookie('refreshToken', res.data!.refreshToken) - navigate("/auction") + window.location.replace("/auction") } return res.data as AuthResponsePayload }) diff --git a/src/pages/AuctionPage/AuctionPage.tsx b/src/pages/AuctionPage/AuctionPage.tsx index 2d3e4bb..1525800 100644 --- a/src/pages/AuctionPage/AuctionPage.tsx +++ b/src/pages/AuctionPage/AuctionPage.tsx @@ -91,7 +91,7 @@ export const AuctionPage = () => { setAuctionItems(res.data) setLoader(false) }) - }, [getCookie('authToken')]) + }, []) return (