Skip to content

Commit

Permalink
fix: 비밀번호 암호화되도록 설정 (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitchannn authored Mar 20, 2024
1 parent fd80c38 commit 748881c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions server/src/main/java/sunflower/server/entity/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Member {
private Long oauthId;
private Boolean isBlind;

public Member(
private Member(
final Long id,
final String nickname,
final String loginId,
Expand All @@ -58,7 +58,14 @@ public Member(
) {
this.nickname = nickname;
this.loginId = loginId;
this.encryptedPassword = password;
this.encryptedPassword = encryptPassword(password);
}

private static String encryptPassword(final String password) {
if (password != null) {
return PasswordUtil.encrypt(password);
}
return null;
}

@Builder(builderMethodName = "oauth")
Expand Down

0 comments on commit 748881c

Please sign in to comment.