소셜 로그인 이메일 미필수 정책 적용
소셜 로그인 시 이메일 동의 없이도 계정 생성이 가능하도록 변경합니다. Member 엔티티의 email 필드를 선택 사항으로 변경하고, 관련 API 응답 및 인증 로직에서 이메일이 없는 경우에 대한 처리를 추가합니다.
This commit is contained in:
@@ -47,7 +47,7 @@ class GoogleAuthService(
|
||||
userId = member.id!!,
|
||||
token = jwt,
|
||||
nickname = member.nickname,
|
||||
email = member.email,
|
||||
email = member.email ?: "",
|
||||
profileImage = if (member.profileImage != null) {
|
||||
"$cloudFrontHost/${member.profileImage}"
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,6 @@ package kr.co.vividnext.sodalive.member.social.google
|
||||
import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier
|
||||
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
|
||||
import com.google.api.client.json.gson.GsonFactory
|
||||
import kr.co.vividnext.sodalive.common.SodaException
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@@ -27,7 +26,7 @@ class GoogleService(
|
||||
|
||||
if (token != null) {
|
||||
val payload = token.payload
|
||||
val email = payload.email ?: throw SodaException(messageKey = "member.social.email_consent_required")
|
||||
val email = payload.email
|
||||
|
||||
GoogleUserInfo(
|
||||
sub = payload.subject,
|
||||
|
||||
@@ -2,6 +2,6 @@ package kr.co.vividnext.sodalive.member.social.google
|
||||
|
||||
data class GoogleUserInfo(
|
||||
val sub: String,
|
||||
val email: String,
|
||||
val email: String?,
|
||||
val name: String?
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ class KakaoAuthService(
|
||||
userId = member.id!!,
|
||||
token = jwt,
|
||||
nickname = member.nickname,
|
||||
email = member.email,
|
||||
email = member.email ?: "",
|
||||
profileImage = if (member.profileImage != null) {
|
||||
"$cloudFrontHost/${member.profileImage}"
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package kr.co.vividnext.sodalive.member.social.kakao
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import kr.co.vividnext.sodalive.common.SodaException
|
||||
import org.springframework.http.HttpEntity
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
@@ -37,7 +36,6 @@ class KakaoService(
|
||||
val id = jsonNode.get("id").asLong()
|
||||
val kakaoAccount = jsonNode.get("kakao_account")
|
||||
val email = kakaoAccount?.get("email")?.asText()
|
||||
?: throw SodaException(messageKey = "member.social.kakao_login_failed")
|
||||
val properties = jsonNode.get("properties")
|
||||
val nickname = properties?.get("nickname")?.asText()
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ package kr.co.vividnext.sodalive.member.social.kakao
|
||||
|
||||
data class KakaoUserInfo(
|
||||
val id: Long,
|
||||
val email: String,
|
||||
val email: String?,
|
||||
val nickname: String?
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user