Skip to content

Commit

Permalink
Merge pull request #585 from boostcampwm2023/FE/bugfix/#584-최초-로그인-시-…
Browse files Browse the repository at this point in the history
…카카오톡-로그인-후-쿠키가-붙지-않음

Fe/bugfix/#584 최초 로그인 시 카카오톡 로그인 후 쿠키가 붙지 않음
  • Loading branch information
HeoJiye authored Mar 1, 2024
2 parents 89703ca + 51059b2 commit 5fcdc17
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
19 changes: 17 additions & 2 deletions frontend/.eslintrc.js → frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@ module.exports = {
browser: true,
es2021: true,
},
extends: ['plugin:pretter/recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:@typescript-eslint/recommended', 'airbnb-typescript', 'plugin:import/recommended', 'prettier', 'plugin:storybook/recommended'],
plugins: ['prettier', 'react-refresh', 'import', 'eslint:recommended'],
extends: [
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-typescript',
'plugin:import/recommended',
'prettier',
'plugin:storybook/recommended',
'eslint:recommended',
],
plugins: ['prettier', 'react-refresh', 'import'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts'],
settings: {
react: {
version: 'detect',
},
},

parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@trivago/prettier-plugin-sort-imports": "4.1.1",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/socket.io-client": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@vitejs/plugin-react": "^4.2.1",
Expand All @@ -68,6 +67,7 @@
"postcss": "^8.4.31",
"storybook": "7.5.3",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.0.11",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.3.0"
Expand Down
24 changes: 10 additions & 14 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions frontend/src/business/hooks/auth/useKakaoOAuthRedirect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import axios from 'axios';
import { useNavigate } from 'react-router-dom';

import { isProdctionMode } from '@utils/env';

import { KAKAO_LOGIN_URL } from '@constants/kakao';

export function useKakaoOAuthRedirect() {
Expand All @@ -11,6 +13,10 @@ export function useKakaoOAuthRedirect() {
const res = await axios.get(KAKAO_LOGIN_URL, {
params: { code },
withCredentials: true,
headers: {
SameSite: 'None',
Secure: isProdctionMode(),
},
});

if (!res || res.status !== 200) {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/utils/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function isProdctionMode() {
return import.meta.env.MODE === 'production';
}

0 comments on commit 5fcdc17

Please sign in to comment.