From ddf62fe3255cf5dbf8883ab139b4ef76521d64bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20B=C3=B6ckmann?= Date: Tue, 2 Apr 2024 15:49:38 +0200 Subject: [PATCH 1/2] fix: trying to bypass rewrites --- src/lib/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/actions.ts b/src/lib/actions.ts index f3beafd..a48fd1c 100644 --- a/src/lib/actions.ts +++ b/src/lib/actions.ts @@ -78,7 +78,7 @@ export async function refreshAccessToken() { // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents export async function getUser(): Promise { try { - const response = await fetch("http://localhost:3000/api/user/get", { + const response = await fetch(process.env.BACKEND_DOMAIN + "/api/user/get", { method: "GET", headers: { "Content-Type": "application/json;charset=UTF-8", @@ -145,7 +145,7 @@ export async function loginUser(prevState: LoginFormState, formData: FormData): const encodedData = new URLSearchParams(data as Record).toString(); try { - const response = await fetch(process.env.FRONTEND_DOMAIN + "/api/user/login", { + const response = await fetch(process.env.BACKEND_DOMAIN + "/api/user/login", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8" From 85fb3a252fea06eae5f62b9d9f6f50c0317aa60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20B=C3=B6ckmann?= Date: Tue, 2 Apr 2024 16:30:22 +0200 Subject: [PATCH 2/2] fix: changed fetch url --- src/lib/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/actions.ts b/src/lib/actions.ts index a48fd1c..8dc65a1 100644 --- a/src/lib/actions.ts +++ b/src/lib/actions.ts @@ -145,7 +145,7 @@ export async function loginUser(prevState: LoginFormState, formData: FormData): const encodedData = new URLSearchParams(data as Record).toString(); try { - const response = await fetch(process.env.BACKEND_DOMAIN + "/api/user/login", { + const response = await fetch("https://ipk-frontend.netlify.app/api/user/login", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"