diff --git a/src/main/java/gwangjang/server/domain/auth/application/dto/response/SignInResponse.java b/src/main/java/gwangjang/server/domain/auth/application/dto/response/SignInResponse.java index 81ca34d..7af9478 100644 --- a/src/main/java/gwangjang/server/domain/auth/application/dto/response/SignInResponse.java +++ b/src/main/java/gwangjang/server/domain/auth/application/dto/response/SignInResponse.java @@ -15,6 +15,7 @@ public class SignInResponse { private String accessToken; private String refreshToken; private Boolean registrationStatus; + private String memberId; public static SignInResponse from(TokenInfoResponse tokenInfoResponse, RegistrationStatus registrationStatus) { return SignInResponse.builder() @@ -23,4 +24,8 @@ public static SignInResponse from(TokenInfoResponse tokenInfoResponse, Registrat .registrationStatus(registrationStatus.equals(RegistrationStatus.COMPLETED)) .build(); } + + public void updateMemberId(String memberId) { + this.memberId = memberId; + } } diff --git a/src/main/java/gwangjang/server/global/response/TokenInfoResponse.java b/src/main/java/gwangjang/server/global/response/TokenInfoResponse.java index 2e26734..ada199a 100644 --- a/src/main/java/gwangjang/server/global/response/TokenInfoResponse.java +++ b/src/main/java/gwangjang/server/global/response/TokenInfoResponse.java @@ -12,13 +12,15 @@ public class TokenInfoResponse { private String accessToken; private String refreshToken; private Long refreshTokenExpirationTime; + private String memberId; - public static TokenInfoResponse from(String grantType, String accessToken, String refreshToken, Long refreshTokenExpirationTime) { + public static TokenInfoResponse from(String grantType, String accessToken, String refreshToken, Long refreshTokenExpirationTime,String socialId) { return TokenInfoResponse.builder() .grantType(grantType) .accessToken(accessToken) .refreshToken(refreshToken) .refreshTokenExpirationTime(refreshTokenExpirationTime) + .memberId(socialId) .build(); } diff --git a/src/main/java/gwangjang/server/global/security/jwt/service/TokenUtil.java b/src/main/java/gwangjang/server/global/security/jwt/service/TokenUtil.java index 7d93b81..389e870 100644 --- a/src/main/java/gwangjang/server/global/security/jwt/service/TokenUtil.java +++ b/src/main/java/gwangjang/server/global/security/jwt/service/TokenUtil.java @@ -78,7 +78,7 @@ public TokenInfoResponse createToken(String socialId, boolean isAdditionalInfoPr .signWith(SignatureAlgorithm.HS256, secretKey) .compact(); - return TokenInfoResponse.from("Bearer", accessToken, refreshToken, refreshTokenValidityTime); + return TokenInfoResponse.from("Bearer", accessToken, refreshToken, refreshTokenValidityTime,socialId); } public boolean verifyToken(String token) {