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

logout을 UserHandler로 이동 #348

Merged
merged 1 commit into from
Mar 5, 2025
Merged

logout을 UserHandler로 이동 #348

merged 1 commit into from
Mar 5, 2025

Conversation

asp345
Copy link
Member

@asp345 asp345 commented Mar 4, 2025

기존 logout api가 AuthHandler에 위치했는데 이게 SnuttRestApiNoAuthMiddleware를 사용하고 있어서 요청의 유저 토큰을 가져오지 못했고 로그아웃이 안됐었어요
경로는 그대로 두고 UserHandler로 옮겨서 제대로 작동하게 만들었습니다

@asp345 asp345 requested review from PFCJeong and a team as code owners March 4, 2025 07:47
@asp345 asp345 requested review from davin111, Hank-Choi and SeonghaeJo and removed request for a team March 4, 2025 07:47
Copy link
Member

@Hank-Choi Hank-Choi left a comment

Choose a reason for hiding this comment

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

좋네요 이거때문에 오류생겼군요
LGTM

Comment on lines -77 to -83
handle(req) {
val userId = req.userId
val logoutRequest: LogoutRequest = req.awaitBodyOrNull() ?: throw ServerWebInputException("Invalid body")
userService.logout(userId, logoutRequest)

OkResponse()
}
Copy link
Member

@Hank-Choi Hank-Choi Mar 4, 2025

Choose a reason for hiding this comment

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

        handle(req, additionalMiddleware = snuttRestApiDefaultMiddleware) {
            val userId = req.userId
            val logoutRequest: LogoutRequest = req.awaitBodyOrNull() ?: throw ServerWebInputException("Invalid body")
            userService.logout(userId, logoutRequest)

            OkResponse()
        }

메소드에 추가할 수 있도록 handle 함수를 만들긴 했습니다.

Copy link
Member

Choose a reason for hiding this comment

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

둘 다 큰 상관없어보이는데
도메인 맥락을 따를지 코드 맥락을 따를지 결정해주세요

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 UserHandler에 있는게 자연스러운거 같아서 원래대로 반영할게요

@asp345 asp345 merged commit 71306bf into develop Mar 5, 2025
2 checks passed
@asp345 asp345 deleted the fix/logout branch March 5, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants