Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
리프레쉬 토큰에 서브젝트 정보 삽입
리프레쉬 토큰 생성 메서드명 오타 수정
(createRereshToken -> createRefreshToken)
  • Loading branch information
MinchoGreenT committed Oct 21, 2023
1 parent 63e6e99 commit b5e5a0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public TokenResponseDto googleLogin(String accessToken) {
Optional<User> userLoginData = userRepository.findByUsernumber(String.valueOf(userInfo.getId()));


String refreshToken = "Bearer " +jwtTokenProvider.createRereshToken(userLoginData.get().getId());
String refreshToken = "Bearer " +jwtTokenProvider.createRefreshToken(userLoginData.get().getId());

TokenResponseDto tokenResponseDto = TokenResponseDto.builder()
.message("OK")
Expand Down Expand Up @@ -123,7 +123,7 @@ public TokenResponseDto kakaoLogin(String accessToken) {
Optional<User> userLoginData = userRepository.findByUsernumber(String.valueOf(userInfo.getId()));


String refreshToken = "Bearer " +jwtTokenProvider.createRereshToken(userLoginData.get().getId());
String refreshToken = "Bearer " +jwtTokenProvider.createRefreshToken(userLoginData.get().getId());

TokenResponseDto tokenResponseDto = TokenResponseDto.builder()
.message("OK")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ public String createAccessToken(Long userId, String roles) { // 토
return token;
}

public String createRereshToken(Long userId) { // 토큰 생성
public String createRefreshToken(Long userId) { // 토큰 생성
Claims claims = Jwts.claims().setSubject(String.valueOf(userId));

Date now = new Date();
String token = Jwts.builder()
.setClaims(claims)
.setIssuedAt(now)
.setExpiration(new Date(now.getTime() + refreshTokenTime))
.signWith(SignatureAlgorithm.HS256, secretKey) // 암호화 알고리즘, secret 값 세팅
Expand Down

0 comments on commit b5e5a0b

Please sign in to comment.