-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/#92 - 채팅 좋아요 취소 기능 구현 #197
Conversation
#193 먼저 머지 후 머지해주세요! |
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.
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.
수고하셨습니다!!
async getAuthenticatedUser(socket: Socket) { | ||
const cookieValue = websocketCookieParse(socket); | ||
const session = await this.getSession(cookieValue); | ||
return session ? session.passport.user : undefined; |
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.
session이 없을 때 undefined를 반환하는 이유가 무엇인가요? 명시적으로 값이 없음을 반환하는 거라면 null이 좋을 것 같아서요!
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.
원래 세션 값을 SessionSocket에 넣는 방식을 생각했습니다. 해당 소켓 내부에 session이라는 필드가 있습니다. 해당 필드는 쿠키의 값으로 세션을 꺼낸 후 넣는 방식이기 때문에 세션을 받기 전에 undefined와 세션을 받은 후 User타입으로 나타납니다.
따라서 SessionSocket의 타입을 맞추기 위해 undefined를 했지만, SessionSocket에 넣을 필요가 없다는 것을 느껴서 null로 바꾸겠습니다!
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.
그리고 웹소켓 핸드쉐이킹 과정에서 SessionSocket에 세션 값을 넣으려는 이유는 채팅을 보낼 때마다 가드 내의 세션 메모리를 사용하지 않고 Socket 내부의 값을 사용하려 했지만, 쿠키 타임아웃을 검증할 때 세션 메모리를 사용할 필요가 있어서 세션값을 소켓에 넣지 않기로 했습니다!
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.
확장자쪽에 ..
이 있네요..!
close #92
✅ 작업 내용
😎 체크 사항