From f70fadd70c4b2211687cc37e8cbb1ccbfbfecdf6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 28 Dec 2023 09:52:30 -0800 Subject: [PATCH 1/2] fix: https connection issue --- backend/dev.sh | 2 +- backend/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/dev.sh b/backend/dev.sh index e4e1aaa1..9d0b5fa4 100644 --- a/backend/dev.sh +++ b/backend/dev.sh @@ -1 +1 @@ -uvicorn main:app --port 8080 --host 0.0.0.0 --reload \ No newline at end of file +uvicorn main:app --port 8080 --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file diff --git a/backend/start.sh b/backend/start.sh index 2d070299..9fb1f576 100644 --- a/backend/start.sh +++ b/backend/start.sh @@ -1 +1 @@ -uvicorn main:app --host 0.0.0.0 --port 8080 \ No newline at end of file +uvicorn main:app --host 0.0.0.0 --port 8080 --forwarded-allow-ips '*' \ No newline at end of file From bdc131378f1399834c2bf1ad78a90279d905fb7a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 28 Dec 2023 09:55:54 -0800 Subject: [PATCH 2/2] fix: trailing slash added to api routes --- src/lib/apis/auths/index.ts | 2 +- src/lib/apis/users/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/apis/auths/index.ts b/src/lib/apis/auths/index.ts index 41c397f9..56a4a7a6 100644 --- a/src/lib/apis/auths/index.ts +++ b/src/lib/apis/auths/index.ts @@ -3,7 +3,7 @@ import { WEBUI_API_BASE_URL } from '$lib/constants'; export const getSessionUser = async (token: string) => { let error = null; - const res = await fetch(`${WEBUI_API_BASE_URL}/auths`, { + const res = await fetch(`${WEBUI_API_BASE_URL}/auths/`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/src/lib/apis/users/index.ts b/src/lib/apis/users/index.ts index 5939d39d..b1f9e5d9 100644 --- a/src/lib/apis/users/index.ts +++ b/src/lib/apis/users/index.ts @@ -34,7 +34,7 @@ export const updateUserRole = async (token: string, id: string, role: string) => export const getUsers = async (token: string) => { let error = null; - const res = await fetch(`${WEBUI_API_BASE_URL}/users`, { + const res = await fetch(`${WEBUI_API_BASE_URL}/users/`, { method: 'GET', headers: { 'Content-Type': 'application/json',