Skip to content

Commit

Permalink
Merge pull request #47 from tukcomCD2024/fix/#46-signup-role
Browse files Browse the repository at this point in the history
Fix/#46 signup role (회원 Role 변경 및 RefreshToken 설정)
  • Loading branch information
yeonjy authored Mar 20, 2024
2 parents 92cf1c8 + 36267ff commit 8facf4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 8facf4c

Please sign in to comment.