From a65944631427da6effadf53474df77db424018fc Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Sun, 11 May 2025 23:17:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EB=B3=B4=EC=A6=9D=EA=B8=88=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20withCredentials:=20true=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Deposit.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/Deposit.jsx b/frontend/src/Deposit.jsx index ce2198c..500de27 100644 --- a/frontend/src/Deposit.jsx +++ b/frontend/src/Deposit.jsx @@ -5,6 +5,7 @@ import { useEffect, useState } from "react"; const Deposit = () => { const [deposit, setDeposit] = useState(null); + useEffect(() => { const user = JSON.parse(localStorage.getItem("user")); const userId = user?.id; @@ -12,7 +13,9 @@ const Deposit = () => { if (!userId) return; axios - .get(`/api/deposit/${userId}`) + .get(`/api/deposit/${userId}`, { + withCredentials: true, // 세션 쿠키 포함 + }) .then((res) => setDeposit(res.data)) .catch((err) => { alert("보증금 정보를 불러오지 못했습니다."); From b9a2515429b7efacfe4d28a971af33cea5fed4d6 Mon Sep 17 00:00:00 2001 From: Imggaggu Date: Sun, 11 May 2025 23:18:39 +0900 Subject: [PATCH 2/2] [Fix] add credential true --- frontend/src/api/assignment.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/assignment.js b/frontend/src/api/assignment.js index 4102105..a576b62 100644 --- a/frontend/src/api/assignment.js +++ b/frontend/src/api/assignment.js @@ -1,5 +1,8 @@ import axios from "axios"; export const fetchAssignmentsByUser = async (userId) => { - const res = await axios.get(`/api/assignment/grouped/${userId}`); return res.data; + const res = await axios.get(`/api/assignment/grouped/${userId}`, { + withCredentials: true + }); + return res.data; };