From 7a739920558c1203dbbc4beddbedcd586c140667 Mon Sep 17 00:00:00 2001 From: leGit-y Date: Fri, 24 Nov 2023 16:17:06 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20apple=20login=20email=EC=86=8D=EC=84=B1?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/authController.ts | 5 +++-- src/service/authService.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controller/authController.ts b/src/controller/authController.ts index 5b2c1b5..478678d 100644 --- a/src/controller/authController.ts +++ b/src/controller/authController.ts @@ -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); diff --git a/src/service/authService.ts b/src/service/authService.ts index 8998133..19bcc83 100644 --- a/src/service/authService.ts +++ b/src/service/authService.ts @@ -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 @@ -83,6 +83,7 @@ const serviceLogin = async (provider:string, user:any) => { userCreateDTO.appleId = id; userCreateDTO.name = fullName; + userCreateDTO.email = email; isNew = true }