Skip to content

Commit

Permalink
fix: prevent recursive redirect between session expired and root (#8777)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad authored Oct 15, 2024
1 parent bf0b5df commit 7518c6b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Components/ErrorPages/SessionExpired.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import * as Notification from "../../Utils/Notifications";
import { useNavigate } from "raviger";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { useAuthContext } from "../../Common/hooks/useAuthUser";

export default function SessionExpired() {
const { signOut, user } = useAuthContext();
const isAuthenticated = !!user;
const navigate = useNavigate();
const { signOut } = useAuthContext();
const { t } = useTranslation();

useEffect(() => {
Notification.closeAllNotifications();
}, []);

if (isAuthenticated) {
navigate("/");
}

return (
<div className="flex h-screen items-center justify-center text-center">
<div className="w-[500px] text-center">
Expand Down

0 comments on commit 7518c6b

Please sign in to comment.