Skip to content

Commit

Permalink
fix: 개발 환경에 따라서 headerOptions 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
HeoJiye committed Mar 6, 2024
1 parent 83244ec commit 0da0a29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frontend/src/business/hooks/auth/useKakaoOAuthRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ export function useKakaoOAuthRedirect() {
const navigate = useNavigate();
const code = new URLSearchParams(window.location.search).get('code');

const headerOptions = isProdctionMode() ? { SameSite: 'None', Secure: true } : {};

const login = async () => {
const res = await axios.get(KAKAO_LOGIN_URL, {
params: { code },
withCredentials: true,
headers: {
SameSite: 'None',
Secure: isProdctionMode(),
},
headers: headerOptions,
});

if (!res || res.status !== 200) {
Expand Down

0 comments on commit 0da0a29

Please sign in to comment.