From 73433345ba2ef50114e0a157a22f2cebbaaab37c Mon Sep 17 00:00:00 2001 From: shinhn Date: Fri, 24 Mar 2023 14:03:06 +0900 Subject: [PATCH] =?UTF-8?q?#8=20refactor=20:=20=EC=95=A0=ED=94=8C=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=EC=8B=9C,=20=EC=95=A0?= =?UTF-8?q?=ED=94=8C=20=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C=20=EB=B0=9B?= =?UTF-8?q?=EC=9D=80=20=EC=9C=A0=EC=A0=80=20=EC=9D=B4=EB=A6=84=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B3=A0=20null?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/applelogin/service/AppleServiceImpl.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/com/yogit/server/applelogin/service/AppleServiceImpl.java b/server/src/main/java/com/yogit/server/applelogin/service/AppleServiceImpl.java index 7753473..f308f93 100644 --- a/server/src/main/java/com/yogit/server/applelogin/service/AppleServiceImpl.java +++ b/server/src/main/java/com/yogit/server/applelogin/service/AppleServiceImpl.java @@ -75,17 +75,17 @@ public TokenResponse requestCodeValidations(ServicesResponse serviceResponse, St String email = user.getAsString("email"); // 이름 추출 - Map name = (Map) user.get("name"); - String lastName = name.get("lastName"); - String firstName = name.get("firstName"); - String fullName = lastName + firstName; +// Map name = (Map) user.get("name"); +// String lastName = name.get("lastName"); +// String firstName = name.get("firstName"); +// String fullName = lastName + firstName; // 만약 처음 인증하는 유저여서 refresh 토큰 없으면 client_secret, authorization_code로 검증 if (client_secret != null && code != null && refresh_token == null) { tokenResponse = appleUtils.validateAuthorizationGrantCode(client_secret, code); // 유저 생성 - CreateUserAppleReq createUserAppleReq = new CreateUserAppleReq(email, tokenResponse.getRefresh_token(),fullName, UserType.APPLE); + CreateUserAppleReq createUserAppleReq = new CreateUserAppleReq(email, tokenResponse.getRefresh_token(),null, UserType.APPLE); saveduser = userService.createUserApple(createUserAppleReq); } // 이미 refresh 토큰 있는 유저면 client_secret, refresh_token로 검증 @@ -169,7 +169,10 @@ public void deleteUser(DeleteUserReq deleteUserReq) { // 유저 정보 삭제 및 유저 상태 변경 (DELETE) tokenService.validateRefreshToken(deleteUserReq.getUserId(), deleteUserReq.getRefreshToken()); + // 유저 entity - 개인 정보 삭제 User user = userRepository.findByUserId(deleteUserReq.getUserId()).orElseThrow(() -> new NotFoundUserException()); user.deleteUser(); + // 유저 연관 entity - 정보 삭제 + } }