This commit is contained in:
hyunho 2020-12-21 00:29:24 +00:00
parent 9d33cc4c9b
commit 48a35843c6
1 changed files with 18 additions and 20 deletions

View File

@ -119,26 +119,24 @@
function loginWithKakao() { function loginWithKakao() {
Kakao.Auth.login({ Kakao.Auth.login({
success: function (authObj) { success: function (authObj) {
success: function (authObj) { Kakao.API.request({
Kakao.API.request({ url: '/v2/user/me',
url: '/v2/user/me', success: function (res) {
success: function (res) { if (res.kakao_account.email == "" || res.kakao_account.email == null || res.kakao_account.email == undefined) {
if (res.kakao_account.email == "" || res.kakao_account.email == null || res.kakao_account.email == undefined) { alert("이메일 제공 동의 후 이용하실 수 있습니다.");
alert("이메일 제공 동의 후 이용하실 수 있습니다."); return;
return; }
} else {
else { location.href = "/Account/KakaoCallback";
location.href = "/Account/KakaoCallback"; }
} },
}, fail: function (error) {
fail: function (error) { alert(
alert( 'login success, but failed to request user information: ' +
'login success, but failed to request user information: ' + JSON.stringify(error)
JSON.stringify(error) )
) },
}, })
})
},
}, },
fail: function (err) { fail: function (err) {
alert("카카오 아이디로 로그인에 실패했습니다."); alert("카카오 아이디로 로그인에 실패했습니다.");