Skip to content

Commit

Permalink
fix: SESSION ID에서 secure 옵션 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 9, 2024
1 parent 02bee7b commit 506bf79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- refactor/about
- refactor/people

jobs:
build:
Expand Down
5 changes: 2 additions & 3 deletions actions/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ import { getRequest } from '@/apis/network/server';
import { COOKIE_SESSION_ID } from '@/constants/network';

export const getMockAuth = async () => {
// TODO: getRequest 함수로 구현
// 지금은 /v1이 segment에 없어서 임시로 fetch를 사용해 직접 구현
const resp = await fetch(`https://cse-dev-waffle.bacchus.io/api/v1/mock-login`, {
method: 'GET',
});

const cookie = resp.headers.getSetCookie()[0];
const value = cookie.split(/=|;/)[1];

cookies().set(COOKIE_SESSION_ID, value, { httpOnly: true, secure: true });
// TODO: 실 배포시 secure 옵션 주기
cookies().set(COOKIE_SESSION_ID, value, { httpOnly: true });
};

export const removeAuth = () => {
Expand Down

0 comments on commit 506bf79

Please sign in to comment.