Redirecting on log out
I'm having trouble getting my login page to render when calling the
logout function provided by react-query-auth. It is changing the URL to /login, but not rendering the component specified by my login route. Leaving the screen and coming back, or refreshing forces the login component to render.
I'm doing this via a guard like:
And my routes look like:
1 Reply
like-goldOP•3y ago
I have a temporary fix by using a
<Link> component on my logout button, and waiting to call logout on my login page, if the user is defined on initial render. But I'm curious if there is a better way to handle this!