Skip to content

Commit ebb4ada

Browse files
committed
Allow for more clock drift when generating the JWT
In my tests, sometimes even though the 10 minutes maximum expire time worked when searching for the comment, it still was possible for the subsequent request (appending to the comment) to fail with: 'Expiration time' claim ('exp') is too far in the future Let's work around that by avoiding the full 10 minutes expiry and going for 9 instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent b7f1171 commit ebb4ada

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

GitForWindowsHelper/github-api-request-as-app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = async (context, requestMethod, requestPath, body) => {
99
const payload = {
1010
// issued at time, 60 seconds in the past to allow for clock drift
1111
iat: now - 60,
12-
// JWT expiration time (10 minute maximum)
13-
exp: now + (10 * 60),
12+
// JWT expiration time (10 minute maximum, use 9 to allow for clock drift)
13+
exp: now + (9 * 60),
1414
// GitHub App's identifier
1515
iss: process.env['GITHUB_APP_ID']
1616
}

0 commit comments

Comments
 (0)