diff --git a/src/components/Login/LoginForm.jsx b/src/components/Login/LoginForm.jsx index 6b2e8d2..b24504d 100644 --- a/src/components/Login/LoginForm.jsx +++ b/src/components/Login/LoginForm.jsx @@ -2,11 +2,12 @@ import { API, URL, getCookie } from '../../API'; import * as S from '../../styles/Form.styles'; import { useState } from 'react'; import CSRFToken from '../CSRFToken/CSRFToken'; -import { Navigate, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import useIsLogged from '../../hooks/network/isLogged'; const LoginForm = () => { const navigate = useNavigate(); + const csrfToken = getCookie('csrftoken'); const setIsLogged = useIsLogged((state) => state.setIsLogged); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); @@ -15,6 +16,7 @@ const LoginForm = () => { API.post(URL.login, { username, password, + csrfmiddlewaretoken: csrfToken, }) .then((res) => { if (res.status === 200) {