Skip to content

Commit

Permalink
Event better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance committed Oct 20, 2023
1 parent 2b33c47 commit a0d9725
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions samples/endpoints/shell/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ export function RootRoute({ setSession, setSubscription }: RootRouteProps) {
// If the user is already authenticated and come back later with a direct hit to a public page,
// without this code, once the user attempt to navigate to a protected page, the user will be asked
// to login again because the AppRouter code is not re-rendered when the location change.
// To try this out:
// - Authenticate to the app with temp/temp
// - Navigate to the /public page and force a full refresh
// - Click on "Go to the protected home page" link
// - If this code work, you should be redirected directly to the home page without having to login
// - If this code fail, you will be redirected to the login page
if (isActiveRouteProtected && !isAuthenticated) {
setIsReady(false);

Expand Down

0 comments on commit a0d9725

Please sign in to comment.