Skip to content

Commit

Permalink
social API에서 apple로그인 시 credential값이 없으면 오류처리
Browse files Browse the repository at this point in the history
  • Loading branch information
gangMac authored and gangMac committed Apr 12, 2021
1 parent 08b4b2e commit 8eef691
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions controllers/userControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ const social = async(req, res) => {
throw new InternalServerError
}
}else{
req.session.userId = user.user_id;
returnResult.rc = 200;
returnResult.rcmsg = resString.SUCCESS;
returnResult.userImg = user.profile_img;
returnResult.userName = user.display_name;
if(user.type == 'apple' && !user.appleIdentifier){
returnResult.rc = 404;
returnResult.message = resString.ERR_APPLE_LOGIN;
}else{
console.log(user)
req.session.userId = user.user_id;
returnResult.rc = 200;
returnResult.rcmsg = resString.SUCCESS;
returnResult.userImg = user.profile_img;
returnResult.userName = user.display_name;
}
res.json(returnResult);
}
})
Expand Down
1 change: 1 addition & 0 deletions util/resConstMsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
ERR_EMAIL: '가입되지 않은 아이디 입니다.',
ERR_SERVER: '서버에 오류가 발생했습니다. 잠시 후 다시 시도해주세요.',
ERR_PASSWORD: '현재 비밀번호가 일치하지 않습니다.',
ERR_APPLE_LOGIN: 'appleIdentifier값이 없습니다.',
SUCCESS: 'OK',
CREATED: '생성되었습니다.',
ERR_TOO_MANY_FAILED_ATTEMPT: '로그인 오류 횟수를 초과했습니다. 잠시후 다시 로그인해주세요.',
Expand Down

0 comments on commit 8eef691

Please sign in to comment.