Navigate user in login/logout functions
I'm trying to make it generic to send my users either to the main page or to the login page when they either login or logout but I'm having trouble doing this in a generic way.
This is my Auth Provider for example, I would like to add to the login/logout sessions a redirect.
I've tried to use
This is my Auth Provider for example, I would like to add to the login/logout sessions a redirect.
I've tried to use
useNavigate but get the error it should be wrapped in a <Router />, I've tried using return <Navigate href="/" /> but this doesn't work either. Anyone able to help me out here?