Skip to content

Commit

Permalink
Merge pull request #223 from Strong-Potato/222-fix-remove-joinspacetoken
Browse files Browse the repository at this point in the history
Fix remove cookie try1 #222
  • Loading branch information
HOOOO98 authored Jan 27, 2024
2 parents bb82e72 + 688cd59 commit 4ecbb91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Modal/Invitation/Invitation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {InvitationProps} from '@/types/Invitation';

function Invitation({inviteCode, modal}: InvitationProps) {
const [isFull, setIsFull] = useRecoilState(isFullMember);
const [, setcookie] = useCookies(['join_space_token']);
const [, , remove] = useCookies(['join_space_token']);
const {data} = useGetMyInfo(true);
const navigate = useNavigate();
const parsedInviteCode = parseInviteCode(inviteCode);
Expand All @@ -33,10 +33,10 @@ function Invitation({inviteCode, modal}: InvitationProps) {
const handleJoin = async () => {
const response = await postJoin(parsedInviteCode!.space_id);
if (response.status === 200) {
setcookie('join_space_token', '');
remove('join_space_token', {path: '/', secure: true, domain: '.tripvote.site', sameSite: 'lax'});
navigate(`/trip/${parsedInviteCode!.space_id}`);
} else if (response.status === 400) {
setcookie('join_space_token', '');
remove('join_space_token', {path: '/', secure: true, domain: '.tripvote.site', sameSite: 'lax'});
modal(false);
setIsFull(true);
}
Expand All @@ -62,7 +62,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperInvalidButton__confirm}
onClick={() => {
modal(false);
setcookie('join_space_token', '');
remove('join_space_token', {path: '/', secure: true, domain: '.tripvote.site', sameSite: 'lax'});
}}
>
확인
Expand All @@ -87,7 +87,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperButton__cancel}
onClick={() => {
modal(false);
setcookie('join_space_token', '');
remove('join_space_token', {path: '/', secure: true, domain: '.tripvote.site', sameSite: 'lax'});
}}
>
취소
Expand All @@ -114,7 +114,7 @@ function Invitation({inviteCode, modal}: InvitationProps) {
className={styles.wrapperButton__cancel}
onClick={() => {
modal(false);
setcookie('join_space_token', '');
remove('join_space_token', {path: '/', secure: true, domain: '.tripvote.site', sameSite: 'lax'});
}}
>
취소
Expand Down

0 comments on commit 4ecbb91

Please sign in to comment.