Skip to content

Commit 1e19065

Browse files
committed
Refactor: KakaoSDK에서 닉네임, 프로필 가져오는 로직 제거
1 parent c010e35 commit 1e19065

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

Projects/DataSource/Sources/Repository/AuthRepository.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ final class AuthRepository: AuthRepositoryProtocol {
1919
// 카카오 로그인을 진행합니다.
2020
func kakaoLogin() async throws -> UserEntity {
2121
let accessToken = try await fetchKakaoToken()
22-
let (nickname, profileImageUrl) = try await fetchKakaoUserInfo()
2322
let user = try await requestServerLogin(
2423
socialType: .kakao,
2524
nickname: nil,
2625
token: accessToken)
2726

28-
try saveNickname(nickname: nickname)
2927
try saveSocialLoginType(socialLoginType: .kakao)
30-
try saveUserProfileImageUrl(profileImageUrl: profileImageUrl)
3128
return user
3229
}
3330

@@ -93,25 +90,6 @@ final class AuthRepository: AuthRepositoryProtocol {
9390
}
9491
}
9592

96-
// 카카오 SDK를 통해 유저의 정보(카카오 닉네임, 프로필 이미지)를 받아옵니다.
97-
private func fetchKakaoUserInfo() async throws -> (nickname: String, profileImageUrl: URL) {
98-
try await withCheckedThrowingContinuation { continuation in
99-
let resultHandler: (User?, Error?) -> Void = { user, error in
100-
if let error {
101-
continuation.resume(throwing: AuthError.unknown(error))
102-
} else if
103-
let nickname = user?.kakaoAccount?.profile?.nickname,
104-
let profileImageUrl = user?.kakaoAccount?.profile?.profileImageUrl {
105-
continuation.resume(returning: (nickname, profileImageUrl))
106-
} else {
107-
continuation.resume(throwing: AuthError.kakaoUserInformationFetchFailed)
108-
}
109-
}
110-
111-
UserApi.shared.me(completion: resultHandler)
112-
}
113-
}
114-
11593
// 서버 로그인을 진행합니다.
11694
private func requestServerLogin(
11795
socialType: SocialLoginType,

0 commit comments

Comments
 (0)