Skip to content

Preserving previous location while authenticating #125

Answered by tannerlinsley
jabidof asked this question in Q&A
Discussion options

You must be logged in to vote

You can capture the location from useLocation or useRouter into something persistent like localStorage or even a ?redirect=url search param, then either declaratively <Navigate> or imperatively useNavigate to a new route. When things are good, do the same back to the original location you captured.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@caturhidayat
Comment options

@V1RE
Comment options

@caturhidayat
Comment options

Answer selected by jabidof
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants