From 9d33cc4c9b63ac3021a863b384b631b0a543b40f Mon Sep 17 00:00:00 2001 From: hyunho Date: Sun, 20 Dec 2020 23:47:50 +0000 Subject: [PATCH] --- FO/Views/Account/IndexBase.cshtml | 21 ++++++++++++++++++++- FO/Views/Account/JoinTSel.cshtml | 19 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/FO/Views/Account/IndexBase.cshtml b/FO/Views/Account/IndexBase.cshtml index 04e6401..8eca081 100644 --- a/FO/Views/Account/IndexBase.cshtml +++ b/FO/Views/Account/IndexBase.cshtml @@ -119,7 +119,26 @@ function loginWithKakao() { Kakao.Auth.login({ success: function (authObj) { - location.href = "/Account/KakaoCallback" + success: function (authObj) { + Kakao.API.request({ + url: '/v2/user/me', + success: function (res) { + if (res.kakao_account.email == "" || res.kakao_account.email == null || res.kakao_account.email == undefined) { + alert("이메일 제공 동의 후 이용하실 수 있습니다."); + return; + } + else { + location.href = "/Account/KakaoCallback"; + } + }, + fail: function (error) { + alert( + 'login success, but failed to request user information: ' + + JSON.stringify(error) + ) + }, + }) + }, }, fail: function (err) { alert("카카오 아이디로 로그인에 실패했습니다."); diff --git a/FO/Views/Account/JoinTSel.cshtml b/FO/Views/Account/JoinTSel.cshtml index cf1f6f1..cb3ad61 100644 --- a/FO/Views/Account/JoinTSel.cshtml +++ b/FO/Views/Account/JoinTSel.cshtml @@ -41,7 +41,24 @@ function loginWithKakao() { Kakao.Auth.login({ success: function (authObj) { - location.href = "/Account/Join?jointype=3"; + Kakao.API.request({ + url: '/v2/user/me', + success: function (res) { + if (res.kakao_account.email == "" || res.kakao_account.email == null || res.kakao_account.email == undefined) { + alert("이메일 제공 동의 후 이용하실 수 있습니다."); + return; + } + else { + location.href = "/Account/Join?jointype=3"; + } + }, + fail: function (error) { + alert( + 'login success, but failed to request user information: ' + + JSON.stringify(error) + ) + }, + }) }, fail: function (err) { alert("카카오 아이디로 회원가입에 실패했습니다.");