From 3332e3f82d3f40588f664904d4ad57eaea5f2247 Mon Sep 17 00:00:00 2001 From: yeonjy Date: Thu, 21 Mar 2024 04:25:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=86=8C=EC=85=9C=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=9E=84=EC=8B=9C=20password=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jwt/filter/JwtAuthenticationProcessingFilter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/core/src/main/java/com/rollthedice/backend/global/jwt/filter/JwtAuthenticationProcessingFilter.java b/backend/core/src/main/java/com/rollthedice/backend/global/jwt/filter/JwtAuthenticationProcessingFilter.java index 1f52c8d6..690fdbb4 100644 --- a/backend/core/src/main/java/com/rollthedice/backend/global/jwt/filter/JwtAuthenticationProcessingFilter.java +++ b/backend/core/src/main/java/com/rollthedice/backend/global/jwt/filter/JwtAuthenticationProcessingFilter.java @@ -78,9 +78,14 @@ private void checkAccessTokenAndAuthentication(HttpServletRequest request, HttpS } public void saveAuthentication(Member member) { + String password = member.getPassword(); + if (password == null) { + password = PasswordUtil.generateRandomPassword(); + } + UserDetails userDetails = User.builder() .username(member.getEmail()) - .password(PasswordUtil.generateRandomPassword()) + .password(password) .roles(member.getRole().name()) .build(); From 36267ffaaab3958eab9cd24759630e8e8a417e13 Mon Sep 17 00:00:00 2001 From: yeonjy Date: Thu, 21 Mar 2024 04:26:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20Role=EC=9D=84=20User=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=ED=95=98=EB=8A=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rollthedice/backend/domain/member/entity/Member.java | 3 ++- .../backend/domain/member/service/MemberService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/core/src/main/java/com/rollthedice/backend/domain/member/entity/Member.java b/backend/core/src/main/java/com/rollthedice/backend/domain/member/entity/Member.java index f25a7332..d75aa018 100644 --- a/backend/core/src/main/java/com/rollthedice/backend/domain/member/entity/Member.java +++ b/backend/core/src/main/java/com/rollthedice/backend/domain/member/entity/Member.java @@ -41,7 +41,8 @@ public void updateRefreshToken(String updateRefreshToken) { this.refreshToken = updateRefreshToken; } - public void updateNickname(String nickname) { + public void signUp(String nickname) { this.nickname = nickname; + this.role = Role.USER; } } diff --git a/backend/core/src/main/java/com/rollthedice/backend/domain/member/service/MemberService.java b/backend/core/src/main/java/com/rollthedice/backend/domain/member/service/MemberService.java index 23233ae1..07f36173 100644 --- a/backend/core/src/main/java/com/rollthedice/backend/domain/member/service/MemberService.java +++ b/backend/core/src/main/java/com/rollthedice/backend/domain/member/service/MemberService.java @@ -15,6 +15,6 @@ public class MemberService { @Transactional public void signUp(SignUpDto dto) { Member member = authService.getMember(); - member.updateNickname(dto.getNickname()); + member.signUp(dto.getNickname()); } }