Skip to content

Commit

Permalink
✨ :: TokenResponse에 토큰 만료 시간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Daybreak312 committed Nov 8, 2023
1 parent 61da7f2 commit ad43ea9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
import lombok.Builder;
import lombok.Getter;

import java.util.Date;

@Getter
@Builder
public class TokenResponse {

private String accessToken;

private Date accessTokenExp;

private String refreshToken;

private Date refreshTokenExp;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ public TokenResponse createToken(String accountId) {
.build()
);

Date now = new Date();

return TokenResponse.builder()
.accessToken(accessToken)
.accessTokenExp(Date(now.getTime() + jwtProperties.getAccessExpiredExp))
.refreshToken(refreshToken)
.refreshTokenExp(Date(now.getTime() + jwtProperties.getRefreshExpiredExp))
.build();
}

Expand Down

0 comments on commit ad43ea9

Please sign in to comment.