Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : 로그인 시 userId 리턴 #29

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down