From 872251250e8279289d035de5ca236e75e6564bb5 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 22 Jul 2026 11:10:02 +0000 Subject: [PATCH] Fix logout (add missing nginx auth proxy) + show name/email in sidebar footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /hk-planner/api/auth/ → central auth nginx block was missing, causing logout to hit the app backend. Also corrects the logout URL and switches from window.location.href='/' to reload(). Shows name + email in sidebar footer. Co-Authored-By: Claude Sonnet 4.6 --- frontend/nginx.conf | 8 ++++++++ frontend/src/components/Layout.tsx | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 7b46eaa..2087d8c 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -24,6 +24,14 @@ server { try_files $uri =404; } + location /hk-planner/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 /hk-planner/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 dbea2d4..d922e50 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -13,8 +13,8 @@ export function Layout({ user, children }: Props) { useFrameViewport('desktop') async function logout() { - await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }) - window.location.href = '/' + await fetch('/hk-planner/api/auth/logout', { method: 'POST', credentials: 'include' }) + window.location.reload() } return ( @@ -29,7 +29,6 @@ export function Layout({ user, children }: Props) { HK Planner -

{user.name}

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