diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 1488390..116ba58 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -42,8 +42,8 @@ export default function UserPage() { const response = await fetch( process.env.NEXT_PUBLIC_MODE === "PROD" - ? "https://d2jam.com/api/v1/login" - : "http://localhost:3005/api/v1/login", + ? "https://d2jam.com/api/v1/session" + : "http://localhost:3005/api/v1/session", { body: JSON.stringify({ username: username, password: password }), method: "POST", diff --git a/src/app/logout/page.tsx b/src/app/logout/page.tsx index 75e9f60..529400b 100644 --- a/src/app/logout/page.tsx +++ b/src/app/logout/page.tsx @@ -9,9 +9,9 @@ export default function UserPage() { async function logout() { const response = await fetch( process.env.NEXT_PUBLIC_MODE === "PROD" - ? "https://d2jam.com/api/v1/logout" - : "http://localhost:3005/api/v1/logout", - { method: "POST", credentials: "include" } + ? "https://d2jam.com/api/v1/session" + : "http://localhost:3005/api/v1/session", + { method: "DELETE", credentials: "include" } ); if (response.ok) { diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index bbdd806..b7ff2f2 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -91,12 +91,14 @@ export default function UserPage() { bio: sanitizedBio, profilePicture: profilePicture, bannerPicture: bannerPicture, + targetUserSlug: user.slug, }), method: "PUT", headers: { "Content-Type": "application/json", authorization: `Bearer ${getCookie("token")}`, }, + credentials: "include", } ); diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx index f39894b..b099748 100644 --- a/src/app/signup/page.tsx +++ b/src/app/signup/page.tsx @@ -68,8 +68,8 @@ export default function UserPage() { const response = await fetch( process.env.NEXT_PUBLIC_MODE === "PROD" - ? "https://d2jam.com/api/v1/signup" - : "http://localhost:3005/api/v1/signup", + ? "https://d2jam.com/api/v1/user" + : "http://localhost:3005/api/v1/user", { body: JSON.stringify({ username: username, password: password }), method: "POST", diff --git a/src/app/u/[slug]/page.tsx b/src/app/u/[slug]/page.tsx index 9c4b3d7..b1ee308 100644 --- a/src/app/u/[slug]/page.tsx +++ b/src/app/u/[slug]/page.tsx @@ -14,8 +14,8 @@ export default function UserPage() { const fetchUser = async () => { const response = await fetch( process.env.NEXT_PUBLIC_MODE === "PROD" - ? `https://d2jam.com/api/v1/user?slug=${slug}` - : `http://localhost:3005/api/v1/user?slug=${slug}` + ? `https://d2jam.com/api/v1/user?targetUserSlug=${slug}` + : `http://localhost:3005/api/v1/user?targetUserSlug=${slug}` ); setUser(await response.json()); };