로그 기록이 없나요?.. 방금도 사용해서 로그인을 했는 데 왜 없을지 궁금합니다 ㅠ
로그인 할 때는 다음 메소드를 호출 하였습니다.
if AuthApi.isKakaoTalkLoginAvailable() {
AuthApi
.shared
.rx
.loginWithKakaoTalk()
.subscribe(
onNext: { [self] (oauthToken) in
print("카카오 앱 로그인 success")
print(oauthToken)
kakaoUserData()
kakaoGetUserToken()
_ = oauthToken
},
onError: { error in
print(error)
}
)
.disposed(by: disposeBag)
} else {
AuthApi
.shared
.rx
.loginWithKakaoAccount()
.subscribe(onNext: { [self] (oauthToken) in
print("웹으로 로그인 success.")
kakaoUserData()
kakaoGetUserToken()
print(oauthToken)
}, onError: { error in
print(error)
})
.disposed(by: disposeBag)
}
해당 oauthToken 로그 파일입니다.
OAuthToken(tokenType: "bearer", accessToken: "u2B0xz6crmkYGINAzhU-sg_mxo87IAZVUWwxeQo9dRoAAAF3QlvfKw", expiresIn: 43199.0, expiredAt: 2021-01-27 17:40:52 +0000, refreshToken: "6NvBAZbbiklxyJ9i2_SOvi6xyooF1GsJ1rpFwwo9dRoAAAF3QlvfKg", refreshTokenExpiresIn: 5183999.0, refreshTokenExpiredAt: 2021-03-28 05:40:52 +0000, scope: Optional("profile"), scopes: Optional(["profile"]))
그 다음
UserApi.shared.rx.me().subscribe(onSuccess: { user in
print("user Email? \(user.kakaoAccount?.email)")
if let email = user.kakaoAccount?.email {
print("email \(email)")
}
}, onError: { error in
print(error)
})
.disposed(by: disposeBag)
me() 호출을 하였구요. response는 이렇게 나왔습니다. 닉네임과 사진은 경로 수정했습니다~
User(id: 1570534943, properties: Optional(["nickname": "문의자", "thumbnail_image": "https://k.kakaocdn.net/img_110x110.jpg", "profile_image": "https://k.kakaocdn.net/mg_640x640.jpg"]), kakaoAccount: Optional(KakaoSDKUser.Account(profileNeedsAgreement: Optional(false), profile: Optional(KakaoSDKUser.Profile(nickname: "문의자", profileImageUrl: Optional(https://k.kakaocdn.net/img_640x640.jpg), thumbnailImageUrl: Optional(https://k.kakaocdn.net/mg_110x110.jpg))), emailNeedsAgreement: Optional(true), isEmailValid: nil, isEmailVerified: nil, email: nil, ageRangeNeedsAgreement: nil, ageRange: nil, birthyearNeedsAgreement: nil, birthyear: nil, birthdayNeedsAgreement: nil, birthday: nil, birthdayType: nil, genderNeedsAgreement: nil, gender: nil, phoneNumberNeedsAgreement: nil, phoneNumber: nil, ciNeedsAgreement: nil, ci: nil, ciAuthenticatedAt: nil, legalNameNeedsAgreement: nil, legalName: nil, legalBirthDateNeedsAgreement: nil, legalBirthDate: nil, legalGenderNeedsAgreement: nil, legalGender: nil)), groupUserToken: nil, connectedAt: Optional(2020-12-22 07:28:19 +0000), synchedAt: nil)
제 아이디로 로그인한 것이고, 이메일 설정되어있습니다.
생일도 지정되어있구요.
확인 부탁드립니다!