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 9fb6913..39707dd 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 @@ -85,7 +85,7 @@ public TokenResponse requestCodeValidations(ServicesResponse serviceResponse, St tokenResponse = appleUtils.validateAuthorizationGrantCode(client_secret, code); // 유저 생성 - CreateUserAppleReq createUserAppleReq = new CreateUserAppleReq(email, tokenResponse.getRefresh_token(),null, UserType.APPLE); + CreateUserAppleReq createUserAppleReq = new CreateUserAppleReq(email, tokenResponse.getRefresh_token(), null, UserType.APPLE, tokenResponse.getAccess_token(), tokenResponse.getExpires_in()); saveduser = userService.createUserApple(createUserAppleReq); } // 이미 refresh 토큰 있는 유저면 client_secret, refresh_token로 검증 diff --git a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserAppleReq.java b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserAppleReq.java index fc9395f..cdfe47a 100644 --- a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserAppleReq.java +++ b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserAppleReq.java @@ -15,9 +15,11 @@ public class CreateUserAppleReq { String refreshToken; String name; UserType userType; + String access_token; + Long expires_in; public static User toEntityUserApple(CreateUserAppleReq createUserAppleReq){ - User user = new User(createUserAppleReq.loginId, createUserAppleReq.refreshToken, createUserAppleReq.name, createUserAppleReq.userType); + User user = new User(createUserAppleReq.loginId, createUserAppleReq.refreshToken, createUserAppleReq.name, createUserAppleReq.userType, createUserAppleReq.access_token, createUserAppleReq.expires_in); return user; } } diff --git a/server/src/main/java/com/yogit/server/user/entity/User.java b/server/src/main/java/com/yogit/server/user/entity/User.java index f993080..3404d37 100644 --- a/server/src/main/java/com/yogit/server/user/entity/User.java +++ b/server/src/main/java/com/yogit/server/user/entity/User.java @@ -57,6 +57,8 @@ public class User extends BaseEntity { private String nationality; private String refreshToken; + private String access_token; + private Long expires_in; @Enumerated(EnumType.STRING) private UserStatus userStatus; @@ -107,13 +109,15 @@ public User (String loginId, String refreshToken, String name){ this.reportedCnt=0; } - public User (String loginId, String refreshToken, String name, UserType userType){ + public User (String loginId, String refreshToken, String name, UserType userType, String access_token, Long expires_in){ this.loginId = loginId; this.refreshToken = refreshToken; this.name = name; this.userType = userType; this.reportingCnt=0; this.reportedCnt=0; + this.access_token = access_token; + this.expires_in = expires_in; } public void addLanguage(Language language){