Skip to content

Commit

Permalink
Drop redirect for root path
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash committed Sep 1, 2024
1 parent 0dd6a28 commit 19cc45e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const Main: FC<Props> = ({ children }) => {
location.pathname !== ROUTE_FORGOT_PASSWORD &&
location.pathname !== ROUTE_RESET_PASSWORD
) {
navigate(
`${ROUTE_LOGIN}?redirect=${encodeURIComponent(location.pathname)}`
);
const redirect =
location.pathname === "/"
? ""
: `?redirect=${encodeURIComponent(location.pathname)}`;
navigate(`${ROUTE_LOGIN}${redirect}`);
}
}, [loading, user, location, navigate]);

Expand Down

0 comments on commit 19cc45e

Please sign in to comment.