Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public enum OAuthErrorCode implements BaseErrorCode {
"콘텐츠 카테고리를 찾을 수 없습니다."
),

WITHDRAWN_USER(
HttpStatus.FORBIDDEN,
"AUTH403_1",
"탈퇴한 회원입니다."
),

DUPLICATE_NICKNAME(
HttpStatus.CONFLICT,
"AUTH409_1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest)
)
.orElseGet(() -> registerNewUser(userInfo));

// 탈퇴한 유저인지 확인
User user = authMethod.getUser();
if (user.getRole() == Role.WITHDRAWN) {
throw new CustomException(OAuthErrorCode.WITHDRAWN_USER);
}

return new CustomOAuth2User(
authMethod.getUser().getId(),
authMethod.getUser().getRole().name(),
Expand Down
Loading