feat: add error handling for sessionStorage in redirect logic across multiple pages

This commit is contained in:
Linus Rath
2026-03-11 23:35:27 +01:00
parent f996ab77b8
commit 7848c90625
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ export default function ContactsPage() {
useEffect(() => {
if (!isAuthenticated) {
try { sessionStorage.setItem('redirect_after_login', window.location.pathname); } catch {}
try { sessionStorage.setItem('redirect_after_login', window.location.pathname); } catch { /* ignore */ }
router.push("/login");
}
}, [isAuthenticated, router]);