Skip to content

Commit 8531d38

Browse files
authored
Merge pull request #180 from JA-yeong-eop-JA-moeu-JA/feat/#179-auth
2 parents dcc6068 + f765c49 commit 8531d38

File tree

6 files changed

+5
-17
lines changed

6 files changed

+5
-17
lines changed

src/main/java/com/jajaja/domain/auth/dto/GoogleResponseDto.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,4 @@ public String getName() {
2626
public String getEmail() {
2727
return attribute.get("email").toString();
2828
}
29-
30-
@Override
31-
public String getPhone() {
32-
return attribute.get("phone_number") != null ? attribute.get("phone_number").toString() : null;
33-
}
3429
}

src/main/java/com/jajaja/domain/auth/dto/KakaoResponseDto.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ public String getProviderId() {
2323

2424
@Override
2525
public String getName() {
26-
return getKakaoAccount().get("name").toString();
27-
}
28-
29-
@Override
30-
public String getPhone() {
31-
return getKakaoAccount().get("phone_number").toString().replaceFirst("^\\+82\\s*", "0").replaceAll("-", "");
26+
Map<String, Object> kakaoProfile = (Map<String, Object>) getKakaoAccount().get("profile");
27+
return kakaoProfile.get("nickname").toString();
3228
}
3329

3430
@Override

src/main/java/com/jajaja/domain/auth/dto/OAuth2ResponseDto.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ public interface OAuth2ResponseDto {
1010

1111
String getName();
1212

13-
String getPhone();
14-
1513
String getEmail();
1614
}

src/main/java/com/jajaja/domain/auth/service/CustomOAuth2UserService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic
7777

7878
} else {
7979
existingMember.updateName(oAuth2Response.getName());
80-
existingMember.updatePhone(oAuth2Response.getPhone());
80+
// existingMember.updatePhone(oAuth2Response.getPhone());
8181
existingMember.updateEmail(oAuth2Response.getEmail());
8282
member = existingMember;
8383
}

src/main/java/com/jajaja/domain/member/converter/MemberConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static Member toEntity(OAuth2ResponseDto oAuth2Response) {
1010
.oauthId(oAuth2Response.getProviderId())
1111
.oauthType(oAuth2Response.getProvider())
1212
.name(oAuth2Response.getName())
13-
.phone(oAuth2Response.getPhone())
13+
// .phone(oAuth2Response.getPhone())
1414
.email(oAuth2Response.getEmail())
1515
.profileKeyName("default-profile-image.png")
1616
.point(0)

src/main/resources/application.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ spring:
3030
authorization-grant-type: authorization_code
3131
client-authentication-method: client_secret_post
3232
scope:
33-
- name
34-
- phone_number
33+
- profile_nickname
3534
- account_email
3635
google:
3736
client-name: google

0 commit comments

Comments
 (0)