Skip to content

fix: 메시지 형식 수정 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
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 @@ -39,7 +39,7 @@ public class AuthService {
@Transactional
public AuthResponse signup(SignupRequestBody body) {
if (userApiRepository.existsUserByEmail(body.getEmail())) {
throw new BadRequestException(messageUtil.getMessage("auth.email.DUPLICATE"));
throw new BadRequestException(messageUtil.getMessage("auth.user.email.DUPLICATE"));
}

String salt = saltedHashUtil.generateSalt();
Expand All @@ -66,7 +66,7 @@ public AuthResponse login(HttpServletResponse response, LoginRequestBody body) {

// if password is incorrect
if (!saltedHashUtil.verifyPassword(body.getPassword(), user.getSalt(), user.getHashedPassword())) {
throw new BadRequestException(messageUtil.getMessage("auth.password.INCORRECT"));
throw new BadRequestException(messageUtil.getMessage("auth.user.password.INCORRECT"));
}

Long userId = user.getId();
Expand Down
14 changes: 12 additions & 2 deletions core/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ jwt.EXPIRED_TOKEN=EXPIRED_TOKEN.
jwt.UNSUPPORTED_TOKEN=UNSUPPORTED_TOKEN.
jwt.WRONG_TYPE_TOKEN=WRONG_TYPE_TOKEN.


#user
auth.user.email.NOTFOUND=EMAIL_NOTFOUND.
auth.user.NOTFOUND=USER_NOTFOUND.
auth.password.INCORRECT=PASSWORD_INCORRECT.
auth.email.DUPLICATE=DUPLICATE_EMAIL.
auth.user.password.INCORRECT=USER_PASSWORD_INCORRECT.
auth.user.email.DUPLICATE=USER_DUPLICATE_EMAIL.
auth.user.INACTIVE=NOT_ACTIVE_USER. Status: {0}


#admin
auth.admin.email.NOTFOUND=ADMIN_EMAIL_NOTFOUND.
auth.admin.NOTFOUND=ADMIN_USER_NOTFOUND.
auth.admin.password.INCORRECT=ADMIN_PASSWORD_INCORRECT.
auth.admin.email.DUPLICATE=ADMIN_DUPLICATE_EMAIL.
auth.admin.INACTIVE=NOT_ACTIVE_ADMIN. Status: {0}

signup.WRONG_FORMAT
signup.email.EMPTY=EMPTY_EMAIL.
signup.password.EMPTY=EMPTY_PASSWORD.
Loading