Redirect, Navigate and redirect don't work for me
I expect to redirect to the login . enter image description here
CodePudding user response:
Before routing, u must check if local storage contain auth_token if auth_token is not present, then redirect to login by using history.push("login path") or what are u using please mention some more details about routing package.
if(localStorage.getItem(key of that auth_token while setting){
history.push(login route)
}
CodePudding user response:
Use the useNavigate in the top of the function. and then ...Sulotion