Skip to content

Commit

Permalink
feat: 리프레시 토큰 검증시 갱신도 함께
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchijinju committed Dec 10, 2024
1 parent dceee02 commit e185fb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
@Data
public class RefreshResponse {
private final String accessToken;
private final String refreshToken;

public RefreshResponse(String accessToken) {
public RefreshResponse(String accessToken, String refreshToken) {
this.accessToken = accessToken;
this.refreshToken = refreshToken;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public RefreshResponse refresh(String refreshToken) {
try {
Long id = jwtProvider.extractId(refreshToken);

return new RefreshResponse(jwtProvider.generateAccessToken(id));
return new RefreshResponse(jwtProvider.generateAccessToken(id), jwtProvider.generateRefreshToken(id));
} catch (ExpiredJwtException e) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "토큰이 만료되었습니다.");
} catch (Exception e) {
Expand Down

0 comments on commit e185fb9

Please sign in to comment.