Skip to content

Commit

Permalink
feat: #123 jwt expiration config notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbator committed Nov 5, 2023
1 parent 1b96984 commit 54b4b0e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

@Component
public class JwtUtil {
private static final int EXPIRATION_TOKEN_TIME = 1000 * 60 * 15;
@Value("${kodemy.jwt.expiration-mins:15}")
private int expirationMins;
@Value("${kodemy.security.jwt.secret-key}")
private String secretKey;

Expand All @@ -40,7 +41,7 @@ public Output generateToken(Input input) {

private Output createToken(String subject, Map<String, ?> claims) {
final Date createdDate = new Date(System.currentTimeMillis());
final Date expirationDate = new Date(createdDate.getTime() + EXPIRATION_TOKEN_TIME);
final Date expirationDate = new Date(createdDate.getTime() + 1000L * 60 * expirationMins);
String bearer = Jwts.builder()
.setSubject(subject)
.setClaims(claims)
Expand Down

0 comments on commit 54b4b0e

Please sign in to comment.