Skip to content

Commit

Permalink
Merge branch 'feature/DRAW-440' into sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
comforest committed Nov 17, 2024
2 parents 87f024b + 0432666 commit 31e2051
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ internal abstract class BaseWebSocketHandler(

private fun getUser(session: WebSocketSession): User? {
val userId = getUserId(session) ?: return null
val encodedNickname = session.getHeader(HEADER_NICKNAME) ?: return null
val encodedNickname = session.getHeader(HEADER_NICKNAME)
val user = userUseCase.getUserDetail(userId)
val nickname = user?.name ?: URLDecoder.decode(encodedNickname, StandardCharsets.UTF_8.toString())

if (user?.name != null) return User(userId, user.name!!)

if (encodedNickname == null) throw InvalidRequestValueException

val nickname = URLDecoder.decode(encodedNickname, StandardCharsets.UTF_8.toString())

return User(userId, nickname)
}
Expand Down

0 comments on commit 31e2051

Please sign in to comment.