From ffbeed38434ece7be28acdf7e3bd900c801a636d Mon Sep 17 00:00:00 2001 From: physcik Date: Thu, 7 May 2026 15:44:45 +0500 Subject: Ranged weapons edit page --- front/src/App.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'front/src/App.tsx') diff --git a/front/src/App.tsx b/front/src/App.tsx index da9cbfd..c3d4b00 100644 --- a/front/src/App.tsx +++ b/front/src/App.tsx @@ -33,14 +33,15 @@ const router = createBrowserRouter([ path: "/weapons", element: (), }, - { - path: "/weapons/:id", - element: (), - }, { path: "/weapons/:id/edit", + errorElement: (), element: (), }, + { + path: "/weapons/:id", + element: (), + }, // auth { @@ -69,7 +70,14 @@ function App() { const [authCookie, ] = useCookies(['X-AUTH-TOKEN']); const [auth, setAuth] = useState(null); useEffect(() => { - GetUserInfo(authCookie['X-AUTH-TOKEN']).then(v => setAuth(v)); + GetUserInfo(authCookie['X-AUTH-TOKEN']).then( + v => { + console.log(v); + if (!v || v == undefined) + document.cookie = "X-AUTH-TOKEN=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; + setAuth(v); + } + ); }, []); return ( -- cgit v1.3