File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,20 @@ import { useTranslation } from "react-i18next";
44import { jwtAuth , getStatus , logOut } from "../api/auth" ;
55import LoggedUserContext from "../contexts/logged-user/logged-user.context" ;
66import parse from "html-react-parser" ;
7+ import { useNavigate } from "react-router-dom" ;
78
89
910export 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 ) {
You can’t perform that action at this time.
0 commit comments