카카오 로그인 작업 개선
This commit is contained in:
@@ -64,6 +64,9 @@ function postOAuthResult(result){
|
||||
if(result == 'join'){
|
||||
window.location.href = 'join.php';
|
||||
}
|
||||
else if(result == 'req_email'){
|
||||
alert('이메일 정보 공유를 허가해 주셔야 합니다.');
|
||||
}
|
||||
else if(result == 'login'){
|
||||
console.log('로그인모드');
|
||||
if(oauthMode=='change_pw'){
|
||||
|
||||
@@ -88,5 +88,5 @@ RootDB::db()->update('member', [
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reset'=>false,
|
||||
'reason'=>"로그인을 성공했습니다."
|
||||
'reason'=>"로그인을 성공했습니다. {$OTPValidUntil}까지 유효합니다."
|
||||
]);
|
||||
@@ -134,6 +134,14 @@ if ($me['code']< 0) {
|
||||
]);
|
||||
}
|
||||
|
||||
if(!($kakao_account['has_email']??false)){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reqOTP'=>false,
|
||||
'reason'=>'이메일 정보 공유를 허가해 주셔야 합니다.',
|
||||
]);
|
||||
}
|
||||
|
||||
$validEmail = $kakao_account['is_email_valid']??false;
|
||||
$verifiedEmail = $kakao_account['is_email_verified']??false;
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ if(!$email){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reqOTP'=>false,
|
||||
'reason'=>'이메일 정보 공유를 허락해 주셔야 합니다.',
|
||||
'reason'=>'이메일 정보 공유를 허가해 주셔야 합니다.',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,10 @@ $oauth_mode = 'login';
|
||||
$me['code'] = Util::array_get($me['code'], 0);
|
||||
$signed = $me['has_signed_up']??false;
|
||||
$kakao_account = $me['kakao_account']??[];
|
||||
if(!$signed){
|
||||
if(!($kakao_account['has_email']??false)||!($kakao_account['email']??false)){
|
||||
$oauth_mode = 'req_email';
|
||||
}
|
||||
else if(!$signed){
|
||||
$oauth_mode = 'join';
|
||||
}
|
||||
else if($me['code']< 0){
|
||||
@@ -62,7 +65,7 @@ else if($me['code']< 0){
|
||||
}
|
||||
}
|
||||
else{
|
||||
$session->kaccount_email = $$kakao_account['email'];
|
||||
$session->kaccount_email = $kakao_account['email'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title>OAuth 로그인 실패</title>
|
||||
|
||||
Reference in New Issue
Block a user