From bb6db6c1667d4210dd37466669db8bbae464bd15 Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Fri, 17 Apr 2026 17:00:10 +0200 Subject: [PATCH] fix: correct API endpoint paths from /api/gateway/api to /api - signup.tsx: fix check-email, register, verify-email, resend-otp paths - login.tsx: fix check-email, login, resend-otp, verify-email paths - forgot-password.tsx: fix forgot-password, reset-password paths - contact.tsx: fix support/tickets path The gateway expects /api/auth/... but frontend was calling /api/gateway/api/auth/... --- src/routes/contact.tsx | 2 +- src/routes/forgot-password.tsx | 4 ++-- src/routes/login.tsx | 8 ++++---- src/routes/signup.tsx | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/routes/contact.tsx b/src/routes/contact.tsx index c6a05b2..8c1f902 100644 --- a/src/routes/contact.tsx +++ b/src/routes/contact.tsx @@ -158,7 +158,7 @@ export default function ContactPage() { "Job Seeker (Apply jobs)": "GENERAL", }; const category = userTypeToCategory[values().userType] || "GENERAL"; - const res = await fetch("/api/gateway/api/support/tickets", { + const res = await fetch("/api/support/tickets", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", diff --git a/src/routes/forgot-password.tsx b/src/routes/forgot-password.tsx index 78a49e2..f2f1b83 100644 --- a/src/routes/forgot-password.tsx +++ b/src/routes/forgot-password.tsx @@ -48,7 +48,7 @@ export default function ForgotPasswordRoute() { } setSubmitting(true); try { - const res = await fetch('/api/gateway/api/auth/forgot-password', { + const res = await fetch('/api/auth/forgot-password', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: email().trim().toLowerCase() }), @@ -82,7 +82,7 @@ export default function ForgotPasswordRoute() { } setSubmitting(true); try { - const res = await fetch('/api/gateway/api/auth/reset-password', { + const res = await fetch('/api/auth/reset-password', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/src/routes/login.tsx b/src/routes/login.tsx index e01e0af..84f2599 100644 --- a/src/routes/login.tsx +++ b/src/routes/login.tsx @@ -107,7 +107,7 @@ export default function LoginRoute() { } setCheckingRole(true); try { - const response = await fetch("/api/gateway/api/auth/check-email", { + const response = await fetch("/api/auth/check-email", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -207,7 +207,7 @@ export default function LoginRoute() { } setSubmitting(true); try { - const res = await fetch("/api/gateway/api/auth/login", { + const res = await fetch("/api/auth/login", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -262,7 +262,7 @@ export default function LoginRoute() { setError(""); setSubmitting(true); try { - const res = await fetch("/api/gateway/api/auth/resend-otp", { + const res = await fetch("/api/auth/resend-otp", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -286,7 +286,7 @@ export default function LoginRoute() { } setSubmitting(true); try { - const verifyRes = await fetch("/api/gateway/api/auth/verify-email", { + const verifyRes = await fetch("/api/auth/verify-email", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", diff --git a/src/routes/signup.tsx b/src/routes/signup.tsx index 21054d9..ab647c3 100644 --- a/src/routes/signup.tsx +++ b/src/routes/signup.tsx @@ -131,7 +131,7 @@ export default function SignupRoute() { } try { - const response = await fetch("/api/gateway/api/auth/check-email", { + const response = await fetch("/api/auth/check-email", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -204,7 +204,7 @@ export default function SignupRoute() { setSubmitting(true); try { - const res = await fetch("/api/gateway/api/auth/register", { + const res = await fetch("/api/auth/register", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -250,7 +250,7 @@ export default function SignupRoute() { } setSubmitting(true); try { - const verifyRes = await fetch("/api/gateway/api/auth/verify-email", { + const verifyRes = await fetch("/api/auth/verify-email", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include", @@ -272,7 +272,7 @@ export default function SignupRoute() { setServerError(""); setSubmitting(true); try { - const res = await fetch("/api/gateway/api/auth/resend-otp", { + const res = await fetch("/api/auth/resend-otp", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, credentials: "include",