Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact: apiV1Instance Auth설정 수정 #60

Merged
merged 5 commits into from
Nov 12, 2023
Merged

refact: apiV1Instance Auth설정 수정 #60

merged 5 commits into from
Nov 12, 2023

Conversation

eric-hjh
Copy link
Contributor

🛠️ 변경사항

  • js-cookie 추가
  • 쿠키를 js-cookie 사용해서 관리
  • apiV1Instance Auth설정 수정
  • apiV1Instance Auth설정 수정하면서 token.ts, UserTokenStore.ts 미사용으로 인하여 삭제
  • axios를 apiV1Instance로 수정


☝️ 유의사항



❗체크리스트

  • 하나의 메소드는 최소의 기능만 하도록 설정했나요?
  • 수정 가능하도록 유연하게 작성했나요?
  • 필요 없는 import문이나 setter 등을 삭제했나요?
  • 기존의 코드에 영향이 없는 것을 확인하였나요?

@eric-hjh eric-hjh self-assigned this Nov 10, 2023
@eric-hjh eric-hjh linked an issue Nov 10, 2023 that may be closed by this pull request
Copy link

vercel bot commented Nov 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Nov 10, 2023 7:12pm

@eric-hjh eric-hjh changed the title react: 토큰 세팅 수정 refact: 토큰 세팅 수정 Nov 10, 2023
@eric-hjh eric-hjh changed the title refact: 토큰 세팅 수정 refact: apiV1Instance Auth설정 수정 Nov 10, 2023
Copy link
Contributor

@HyunTaek5 HyunTaek5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿! 👍 코멘트 하나 남겨두었습니다! 시간되실때 확인부탁드려요 😄


const apiV1Instance = axios.create({
baseURL: process.env.NEXT_PUBLIC_API,
headers: {
'Content-Type': 'application/json',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content-Type 옵션은 header에 기존처럼 명시해주시는게 좋습니다. 해당 api 요청이 body에 어떤 정보를 담고 있는지 headers 옵션을 주는 것이 권장되는 방식으로 알고 있습니다 :)

참고 링크)
https://github.com/axios/axios#-html-form-posting-browser

@eric-hjh eric-hjh merged commit 78fdd85 into develop Nov 12, 2023
3 checks passed
@eric-hjh eric-hjh deleted the feat/i59 branch November 12, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] apiV1Instance Auth설정 수정
2 participants