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 }