Skip to content

Commit

Permalink
Avoid visiting login page again on back button click (#8537)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com>
  • Loading branch information
kantuni and timdorr committed Dec 27, 2021
1 parent 6a87133 commit c455e6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.yml
Expand Up @@ -23,3 +23,4 @@
- turansky
- underager
- vijaypushkin
- kantuni
2 changes: 1 addition & 1 deletion examples/auth/src/App.tsx
Expand Up @@ -136,7 +136,7 @@ function RequireAuth({ children }: { children: JSX.Element }) {
// trying to go to when they were redirected. This allows us to send them
// along to that page after they login, which is a nicer user experience
// than dropping them off on the home page.
return <Navigate to="/login" state={{ from: location }} />;
return <Navigate to="/login" state={{ from: location }} replace />;
}

return children;
Expand Down

0 comments on commit c455e6c

Please sign in to comment.