Skip to content
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 @@ -37,9 +37,10 @@ public static UserResponseDTO.OAuthResponse toOAuthResponse(TokenDTO accessToken
.build();
}

public static TokenListDTO toTokenList(List<TokenDTO> tokens){
public static TokenListDTO toTokenList(List<TokenDTO> tokens, Boolean isExist){
return TokenListDTO.builder()
.tokenList(tokens)
.isExist(isExist)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ public TokenListDTO loginGoogle(String token) {
List<TokenDTO> tokenDTOList = new ArrayList<>();
tokenDTOList.add(refreshToken);
tokenDTOList.add(accessToken);

return UserConverter.toTokenList(tokenDTOList);
// 로그인 진행
boolean isExist = true;
return UserConverter.toTokenList(tokenDTOList, isExist);
} else {
User user = userRepository.save(UserConverter.toGoogleUser(googleProfile));
TokenDTO accessToken = jwtTokenProvider.createAccessToken(user.getEmail());
Expand All @@ -107,8 +108,9 @@ public TokenListDTO loginGoogle(String token) {
List<TokenDTO> tokenDTOList = new ArrayList<>();
tokenDTOList.add(refreshToken);
tokenDTOList.add(accessToken);

return UserConverter.toTokenList(tokenDTOList);
// 회원가입 진행
boolean isExist = false;
return UserConverter.toTokenList(tokenDTOList, isExist);
}
}

Expand Down Expand Up @@ -139,7 +141,8 @@ public TokenListDTO reissueToken(String token) {
// Redis에 refresh token 업데이트
redisTemplate.opsForValue().set("RT:" + email, newRefreshToken.getToken(), newRefreshToken.getTokenExpriresTime().getTime(), TimeUnit.MILLISECONDS);

return UserConverter.toTokenList(tokenDTOList);
Boolean isExist = true;
return UserConverter.toTokenList(tokenDTOList, isExist);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public TokenListDTO loginGmail(UserRequestDTO.GoogleEmailRequest request) {
List<TokenDTO> tokenDTOList = new ArrayList<>();
tokenDTOList.add(refreshToken);
tokenDTOList.add(accessToken);
Boolean isExist = true;

return UserConverter.toTokenList(tokenDTOList);
return UserConverter.toTokenList(tokenDTOList, isExist);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public ApiResponse<TokenListDTO> loginGoogleEmail(@RequestBody @Valid UserReques
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공"),
})
@Parameters({
@Parameter(name = "token", description = "query string(RequestParam) - refreshToken 입력"),
@Parameter(name = "RTK", description = "query string(RequestParam) - refreshToken 입력"),
})
@GetMapping("/login/reissue")
public ApiResponse<TokenListDTO> reissueGoogleLoginInfo(@RequestParam(value = "RTK") String token) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
@Builder
public class TokenListDTO {
private List<TokenDTO> tokenList;
private Boolean isExist; // 회원여부 (0:비회원, 1:회원)
}
Loading