Skip to content

Commit

Permalink
[DPMBE-118]이메일 허용 안했을때 발생하는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomo authored Jul 14, 2023
2 parents 40bcc23 + 79b1246 commit da84251
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ package com.depromeet.whatnow.api.auth.dto.response
import com.depromeet.whatnow.api.auth.helper.OauthUserInfoDto

data class OauthUserInfoResponse(
val email: String?,
val profileImage: String,
val isDefaultImage: Boolean,
val nickname: String,
) {

companion object {
fun from(oauthUserInfoDto: OauthUserInfoDto): OauthUserInfoResponse {
return OauthUserInfoResponse(oauthUserInfoDto.email, oauthUserInfoDto.profileImage, oauthUserInfoDto.isDefaultImage, oauthUserInfoDto.username)
return OauthUserInfoResponse(oauthUserInfoDto.profileImage, oauthUserInfoDto.isDefaultImage, oauthUserInfoDto.username)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class KakaoOauthHelper(
fun getUserInfo(oauthAccessToken: String): OauthUserInfoDto {
val response = kakaoInfoClient.kakaoUserInfo(BEARER + oauthAccessToken)
val kakaoAccount: KakaoInformationResponse.KakaoAccount = response.kakaoAccount
return OauthUserInfoDto(response.id, kakaoAccount.profile.profileImageUrl, kakaoAccount.profile.isDefaultImage, kakaoAccount.profile.nickname, kakaoAccount.email, OauthProvider.KAKAO)
return OauthUserInfoDto(response.id, kakaoAccount.profile.profileImageUrl, kakaoAccount.profile.isDefaultImage, kakaoAccount.profile.nickname, OauthProvider.KAKAO)
}

fun getOIDCDecodePayload(token: String): OIDCDecodePayload {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ data class OauthUserInfoDto(
val profileImage: String,
val isDefaultImage: Boolean,
val username: String,
val email: String?,
val oauthProvider: OauthProvider,
) {
fun toOauthInfo(): OauthInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class JwtOIDCHelper {
body.issuer,
body.audience,
body.subject,
body["email", String::class.java],
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ data class OIDCDecodePayload(
/** oauth provider account unique id */
val sub: String,

val email: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ data class KakaoInformationResponse(
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class)
data class KakaoAccount(
val profile: Profile,
val email: String?,
) {

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class KakaoInfoClientTest {
),
)
var response = kakaoInfoClient.kakaoUserInfo("accessToken")
assertEquals(response.kakaoAccount.email, "sample@sample.com")
assertEquals(response.kakaoAccount.profile.profileImageUrl, "http://yyy.kakao.com/dn/.../img_640x640.jpg")
assertEquals(response.kakaoAccount.profile.isDefaultImage, false)
}
Expand Down

0 comments on commit da84251

Please sign in to comment.