upd
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { Navigate, Outlet } from "react-router";
|
||||
import useAuthStore from "../stores/useAuthStore";
|
||||
|
||||
function ProtectedPage() {
|
||||
const { token } = useAuthStore();
|
||||
|
||||
return token ? <Outlet /> : <Navigate to="/login" />;
|
||||
}
|
||||
|
||||
export default ProtectedPage;
|
||||
Reference in New Issue
Block a user