다국어 메시지 분리 적용
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user