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 @@ -23,17 +23,8 @@ public UserJpaEntity process(final OAuthUserInfo info) {
return userRepository.findByPhoneNumber(
PhoneNumberUtil.formatPhoneNumber(info.phoneNumber()))
.map(existingUser -> {
switch (existingUser.getProvider()) {
case MOSU:
if (existingUser.isPendingUser()) {
throw new OAuthException("DUPLICATE");
}
break;
case KAKAO:
if (existingUser.isPendingUser()) {
throw new OAuthException("KAKAO_DUPLICATE");
}
break;
if (existingUser.isMosuUser()) {
throw new OAuthException("DUPLICATE");
}
existingUser.updateOAuthUser(
info.gender(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[!@#$%^&*_/+=])[A-Za-z\\d!@#$%^&*_/+=]{8,20}$", message = "비밀번호 형식이 올바르지 않습니다.")
@Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[!@#$%^&*_/+=])[A-Za-z\\d!@#$%^&*_/+=]{8,20}$", message = "비밀번호 형식이 올바르지 않습니다.")

Choose a reason for hiding this comment

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

medium

정규식에서 대소문자 구분이 제거된 변경사항은 잘 확인했습니다. 하지만 이 어노테이션의 기본 메시지는 아직 수정되지 않았습니다. 19행의 message() 기본값이 이전 정규식의 요구사항("영문 대/소문자")을 여전히 언급하고 있어, 이 어노테이션을 사용하는 다른 곳에서 혼동을 줄 수 있습니다. 현재 정규식과 일치하도록 수정하는 것이 좋겠습니다.

추천 수정안:

// line 19
String message() default "비밀번호는 8~20자의 영문, 숫자, 특수문자를 모두 포함해야 합니다.";

@NotBlank
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public enum Whitelist {
OAUTH2("/api/v1/oauth2", WhitelistMethod.ALL),
OAUTH("/api/v1/oauth", WhitelistMethod.ALL),

// 삭제 예정
MASTER("/api/v1/master", WhitelistMethod.ALL),

// 조회만 가능한 PATH
EVENT("/api/v1/event", WhitelistMethod.GET),
FAQ("/api/v1/faq", WhitelistMethod.GET),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public record SignUpAccountRequest(
String id,

@Schema(
description = "비밀번호는 8~20자의 영문 대/소문자, 숫자, 특수문자를 모두 포함해야 합니다.",
description = "비밀번호는 8~20자의 영문, 숫자, 특수문자를 모두 포함해야 합니다.",
example = "Mosu!1234"
)
@PasswordPattern String password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public record ChangePasswordRequest(
@Schema(
description = "새로운 비밀번호는 8~20자의 영문 대/소문자, 숫자, 특수문자를 모두 포함해야 합니다.",
description = "새로운 비밀번호는 8~20자의 영문, 숫자, 특수문자를 모두 포함해야 합니다.",
example = "Mosu!1234"
)
@PasswordPattern
Expand Down