Skip to content

Commit

Permalink
🚑 fix: Add periodic re-verification of authentication in ProtectedRou…
Browse files Browse the repository at this point in the history
…te component
  • Loading branch information
caverav committed Nov 15, 2024
1 parent fe90fd3 commit be79ac0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/components/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const ProtectedRoute = ({ children }: ProtectedRouteProps) => {
};

verifyAuth().catch(console.error);

const intervalId = setInterval(() => {
verifyAuth().catch(console.error);
}, 30000);

return () => clearInterval(intervalId);
}, [isAuth, navigate]);

if (loading) {
Expand Down

0 comments on commit be79ac0

Please sign in to comment.