Skip to content

Commit 269bcf4

Browse files
committed
Update JWTModal.js
1 parent e57a8f4 commit 269bcf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/JWTModal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ import { useTranslation } from "react-i18next";
44
import { jwtAuth, getStatus, logOut } from "../api/auth";
55
import LoggedUserContext from "../contexts/logged-user/logged-user.context";
66
import parse from "html-react-parser";
7+
import { useNavigate } from "react-router-dom";
78

89

910
export const LoginWithJWT = props => {
1011
const [errors, setErrors] = useState({});
1112
const { setLogged, setAuthType } = useContext(LoggedUserContext);
1213
const { t } = useTranslation("JWTModal");
14+
const navigate = useNavigate();
1315

1416
async function handleClick(event) {
1517
event.preventDefault();
1618
try {
1719
await logOut();
18-
await jwtAuth();
20+
await jwtAuth(navigate);
1921
await getStatus(setLogged, setAuthType);
2022
handleClose();
2123
} catch (error) {

0 commit comments

Comments
 (0)