Skip to content

Commit

Permalink
do not redirect to login while user is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker committed Sep 15, 2023
1 parent 3c7d8c0 commit 4699d65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ts/react-auth/src/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ interface ProtectedRouteProps {

function ProtectedRoute({ redirectPath, access, element }: ProtectedRouteProps): JSX.Element | null {
const {
state: { initializing, user },
state: { initializing, loading, user },
hasAccess,
} = useContext(AuthContext);

const location = useLocation();

if (initializing) {
if (initializing || loading) {
return <div></div>;
}

Expand Down

0 comments on commit 4699d65

Please sign in to comment.