다국어 메시지 분리 적용

This commit is contained in:
2025-12-23 16:19:04 +09:00
parent 39d13ab7c3
commit f429ffbbbe
7 changed files with 138 additions and 42 deletions

View File

@@ -85,12 +85,14 @@ class TokenProvider(
val authorities = claims[AUTHORITIES_KEY].toString().split(",").map { SimpleGrantedAuthority(it) }
val memberToken = tokenRepository.findByIdOrNull(id = claims.subject.toLong())
?: throw SodaException("로그인 정보를 확인해주세요.")
?: throw SodaException(messageKey = "common.error.bad_credentials")
if (!memberToken.tokenSet.contains(token)) throw SodaException("로그인 정보를 확인해주세요.")
if (!memberToken.tokenSet.contains(token)) {
throw SodaException(messageKey = "common.error.bad_credentials")
}
val member = repository.findByIdOrNull(id = claims.subject.toLong())
?: throw SodaException("로그인 정보를 확인해주세요.")
?: throw SodaException(messageKey = "common.error.bad_credentials")
val principal = MemberAdapter(member)
return UsernamePasswordAuthenticationToken(principal, token, authorities)