feat(web): soft-redirect to login on 401 via a navigate bridge (#48)

This commit is contained in:
2026-06-08 14:58:25 +02:00
parent 76f65a95dd
commit 3c59f47f81
4 changed files with 95 additions and 7 deletions
+16
View File
@@ -0,0 +1,16 @@
import { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { setNavigate } from "../api/auth-redirect";
/** Bridges React Router's navigate to the non-React 401 handler. Renders nothing. */
export function NavigationBridge() {
const navigate = useNavigate();
useEffect(() => {
setNavigate(navigate);
return () => setNavigate(null);
}, [navigate]);
return null;
}