This commit is contained in:
Mikola 2023-12-20 19:16:35 +03:00
parent b3e018fa70
commit 7d29222534
2 changed files with 2 additions and 5 deletions

View File

@ -1,5 +1,4 @@
import React from "react"; import React from "react";
import { useNavigate } from "react-router-dom";
import { ButtonUi, ButtonUiType } from "../../../../shared/UI/ButtonUi"; import { ButtonUi, ButtonUiType } from "../../../../shared/UI/ButtonUi";
@ -15,8 +14,6 @@ import styles from "./authLoginForm.module.scss";
export const AuthLoginFormUi = () => { export const AuthLoginFormUi = () => {
const navigate = useNavigate();
const schema = yup.object().shape({ const schema = yup.object().shape({
username: yup.string() username: yup.string()
.min(3, 'Минимум 3 символа!') .min(3, 'Минимум 3 символа!')
@ -50,7 +47,7 @@ export const AuthLoginFormUi = () => {
} else { } else {
setCookie('authToken', res.data!.authToken) setCookie('authToken', res.data!.authToken)
setCookie('refreshToken', res.data!.refreshToken) setCookie('refreshToken', res.data!.refreshToken)
navigate("/auction") window.location.replace("/auction")
} }
return res.data as AuthResponsePayload return res.data as AuthResponsePayload
}) })

View File

@ -91,7 +91,7 @@ export const AuctionPage = () => {
setAuctionItems(res.data) setAuctionItems(res.data)
setLoader(false) setLoader(false)
}) })
}, [getCookie('authToken')]) }, [])
return ( return (
<div className={styles.home}> <div className={styles.home}>