Skip to content

Commit

Permalink
fix: credentials 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Cllaude99 committed Oct 20, 2024
1 parent 8f7a1f0 commit 128f4d3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/components/Modal/PlaceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,25 @@ export default function PlaceModal({ isOpen, onClose }: ModalProps) {
localStorage.removeItem('refreshToken');
localStorage.removeItem('roomId');
if (selectedOption === 'friend') {
const { data } = await axios.post(BACKEND_URL + '/api/rooms', {
roomType: ROOM_TYPE_EACH,
});
const { data } = await axios.post(
BACKEND_URL + '/api/rooms',
{
roomType: ROOM_TYPE_EACH,
},
{ withCredentials: true },
);
setRoomId(data.data.id);
setCurrentView('shareLink');
} else {
const { data } = await axios.post(BACKEND_URL + '/api/rooms', {
roomType: ROOM_TYPE_ALONE,
});
const { data } = await axios.post(
BACKEND_URL + '/api/rooms',
{
roomType: ROOM_TYPE_ALONE,
},
{
withCredentials: true,
},
);
const newRoomId = data.data.id;
navigate(`/page/a/results/${newRoomId}`);
}
Expand Down

0 comments on commit 128f4d3

Please sign in to comment.