-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat/#326 vote credential #327
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WithCredentials: true
옵션을 쓸 경우에는 쿠키로 통신하는건가요?! 비회원 로직을 서버랑 어떻게 짠건지 궁금해요!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 맞습니다! withCredentials 설정을 통해서 투표 관련 get, post API에만 쿠키 통신을 허용했어요!
비회원은 따로 쿠키가 없기 때문에, 요청에 쿠키가 없으면 세션아이디를 따로 만들어요. 이 아이디를 사용해서 비즈니스 로직을 수행한다고 합니다! (서버)
💡 왜 투표 API에만 설정했는가!
기존에는 전역에
withCredentials: true
를 설정했었는데요. 그렇게 되면 프론트에서 작업할 때, 모바일웹 확인이 어렵습니다. (로컬에서)저희가 withCredentials 설정을 하는 것처럼, 서버 측에서도
Access-Control-Allow-Origin
설정을 해줘야 해요! 이 설정에 웹 주소가 들어가지 않으면, 저희 지금 DEV 서비스 투표 부분에 데이터가 없는 것처럼 통신을 하지 못하는데요👀모바일주소가 알다시피..
http://IP주소:5173
라 서버에서 미리 설정을 해주지 못해요.그래서 전역 설정하면 아예 모바일 확인이 어려우니 투표 부분만 보지 말자! 라는 차선책으로 부분 적용하게 되었습니다!!
@ilmerry 이해안가는 부분이 있다면 말해주세요😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 그래서 로컬에서는 투표 부분이 에러가 난거군요! 쿠키가 없으면 세션아이디 만드는 방법 굉장히 신박하네요,,
그러면 원래는 쿠키를 써서 로그인을 구현했다가, 최근에 그 방식을 로컬스토리지로 바꾼거 맞나요??