Skip to content

Commit

Permalink
fix: fix register error
Browse files Browse the repository at this point in the history
  • Loading branch information
minaamim committed Mar 20, 2024
1 parent c1b41a0 commit 22215b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ private JwtUser newMember(OAuthInfoResponse oAuthInfoResponse) {
List<String> list = generateNickname();
String nickname = list.get(0);
String profile = list.get(1);
String gender = oAuthInfoResponse.getGender();
String ageRange = oAuthInfoResponse.getAgeRange();
if(gender == null) gender = Gender.etc.getValue();
if(ageRange == null) ageRange = "";
while (userRepository.existsByNickname(nickname)) {
list = generateNickname();
nickname = list.get(0);
Expand All @@ -66,11 +62,11 @@ private JwtUser newMember(OAuthInfoResponse oAuthInfoResponse) {

User user = User.builder()
.name(oAuthInfoResponse.getNickname())
.gender(gender)
.gender(oAuthInfoResponse.getGender())
.email(email)
.nickname(nickname)
.profile(profile)
.ageRange(ageRange)
.ageRange(oAuthInfoResponse.getAgeRange())
.oAuthProvider(oAuthInfoResponse.getOAuthProvider())
.role(Role.USER)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ static class KakaoAccount {
private String email;
private String gender;
private String age_range;

}

@Getter
Expand All @@ -30,10 +29,20 @@ static class KakaoProfile {
}

@Override
public String getGender() { return kakaoAccount.gender; }
public String getGender() {
if (kakaoAccount.gender == null) {
return "etc";
}
return kakaoAccount.gender;
}

@Override
public String getAgeRange() { return kakaoAccount.age_range; }
public String getAgeRange() {
if (kakaoAccount.age_range == null) {
return "";
}
return kakaoAccount.age_range;
}

@Override
public String getEmail() {
Expand Down

0 comments on commit 22215b8

Please sign in to comment.