Skip to content

Commit

Permalink
[FIX] apple login email속성 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
leGit-y committed Nov 24, 2023
1 parent 7b89454 commit 7a73992
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/controller/authController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ const kakaoLogin_getAuthorizedCode = async (req: Request, res: Response, next: N

const appleLogin =async (req: Request, res:Response, next:NextFunction) => {
try {
const { identityToken, user, fullName } = req.body
const { identityToken, user, fullName, email } = req.body
const DTO = {
identityToken: identityToken,
id: user,
fullName: fullName
fullName: fullName,
email: email,
}
const data = await authService.serviceLogin("apple", DTO);

Expand Down
3 changes: 2 additions & 1 deletion src/service/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const serviceLogin = async (provider:string, user:any) => {
});

// 전달받은 identityToken이 변조되지 않은 올바른 토큰인지 확인하는 과정
const {identityToken, id, fullName} = user;
const {identityToken, id, fullName, email} = user;
// console.log(identityToken,id,fullName)
const decoded = jwt.decode(identityToken, { complete: true})
const kid = decoded.header.kid
Expand Down Expand Up @@ -83,6 +83,7 @@ const serviceLogin = async (provider:string, user:any) => {

userCreateDTO.appleId = id;
userCreateDTO.name = fullName;
userCreateDTO.email = email;
isNew = true
}

Expand Down

0 comments on commit 7a73992

Please sign in to comment.