diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 6a02663..018e4e6 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -25,6 +25,14 @@ server { try_files $uri =404; } + location /cashup/api/auth/ { + proxy_pass http://10.10.10.101:3001/api/auth/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Cache-Control "no-store"; + } + location /cashup/api/ { proxy_pass http://backend:3001/api/; proxy_set_header Host $host; diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 461d0a0..725b1ed 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react' -import { NavLink, useNavigate, useLocation } from 'react-router-dom' +import { NavLink, useLocation } from 'react-router-dom' import { Banknote, ClipboardList, BarChart2, Wallet, Vault, FileText, Settings, LogOut, Menu, } from 'lucide-react' @@ -33,7 +33,6 @@ const navItems: { to: string; label: string; icon: typeof Banknote; cap?: Cashup ] export function Layout({ user, children }: Props) { - const navigate = useNavigate() const location = useLocation() const isMobile = useIsMobile() const [menuOpen, setMenuOpen] = useState(false) @@ -42,7 +41,6 @@ export function Layout({ user, children }: Props) { async function logout() { await fetch('/cashup/api/auth/logout', { method: 'POST', credentials: 'include' }) - navigate('/login', { replace: true }) window.location.reload() } @@ -62,7 +60,6 @@ export function Layout({ user, children }: Props) { Cash Up -

{user.name}

@@ -82,10 +79,14 @@ export function Layout({ user, children }: Props) {
+
+
{user.name}
+
{user.email}
+