Authorization working

This commit is contained in:
2025-02-24 21:53:20 -05:00
parent 2186889b11
commit 5bb6e0a37f
37 changed files with 5723 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { useAuth } from "@/providers/AuthProvider";
import { NavLink } from "react-router";
const protectedLinks = [
{
name: "Games",
path: "/game"
},
{
name: "Groups",
path: "/raidGroup"
},
{
name: "Admin",
path: "/admin"
},
{
name: "Logout",
path: "/logout"
}
];
export default function ProtectedNavLinks(){
const { jwt } = useAuth();
if(!jwt){
return <></>;
}
return (
<>
{
protectedLinks.map((link) => (
<NavLink
key={link.name}
to={link.path}
>
{link.name}
</NavLink>
))
}
</>
);
}