diff --git a/frontend/nginx.conf b/frontend/nginx.conf
index e924f23..de4c24a 100644
--- a/frontend/nginx.conf
+++ b/frontend/nginx.conf
@@ -8,6 +8,14 @@ server {
try_files $uri =404;
}
+ location /twin-optimiser/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 /twin-optimiser/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 0412431..14c6402 100644
--- a/frontend/src/components/Layout.tsx
+++ b/frontend/src/components/Layout.tsx
@@ -9,8 +9,8 @@ interface Props {
export function Layout({ user, children }: Props) {
async function logout() {
- await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' })
- window.location.href = '/'
+ await fetch('/twin-optimiser/api/auth/logout', { method: 'POST', credentials: 'include' })
+ window.location.reload()
}
return (
@@ -25,7 +25,6 @@ export function Layout({ user, children }: Props) {
{user.name}