Skip to content

Commit

Permalink
Update time
Browse files Browse the repository at this point in the history
  • Loading branch information
C4tWithShell committed Feb 15, 2024
1 parent b296d3e commit 58cbdd1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public RepositoryAuthenticationToken getInstallationToken(String apiUrl, String

Instant issued = clock.instant().minus(10, ChronoUnit.SECONDS);
Instant expiry = issued.plus(2, ChronoUnit.MINUTES);
String jwtToken = Jwts.builder().setIssuedAt(Date.from(issued)).setExpiration(Date.from(expiry))
Date createdDate = new Date();
Date expirationDate = new Date(createdDate.getTime() + 120 * 1000);
String jwtToken = Jwts.builder().setIssuedAt(createdDate).setExpiration(expirationDate)
.claim("iss", appId).signWith(createPrivateKey(apiPrivateKey), SignatureAlgorithm.RS256).compact();

Optional<RepositoryAuthenticationToken> repositoryAuthenticationToken = findTokenFromAppInstallationList(getV3Url(apiUrl) + "/app/installations", jwtToken, projectPath);
Expand Down

0 comments on commit 58cbdd1

Please sign in to comment.