mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
13 lines
290 B
TypeScript
13 lines
290 B
TypeScript
import { Navigate, Outlet } from "react-router";
|
|
import { useAuth } from "@/providers/auth-provider";
|
|
|
|
export const AuthGuard = () => {
|
|
const { isAuthenticated } = useAuth();
|
|
|
|
if (!isAuthenticated) {
|
|
return <Navigate to="/login" replace />;
|
|
}
|
|
|
|
return <Outlet />;
|
|
};
|