Skip to content

Commit 7acb483

Browse files
author
Dan Hsiung
committed
servers: Don't use an auth token that expires within 1 second.
1 parent eda5597 commit 7acb483

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

packages/sdk/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
# Changelog
44

5+
## [1.5.4] - 2025-04-25
6+
7+
### Added
8+
9+
- Changed server-side authorized requests to refresh its auth token if it expires within 1 second.
10+
511
## [1.5.3] - 2025-04-18
612

713
### Added

packages/sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pipedream/sdk",
33
"type": "module",
4-
"version": "1.5.3",
4+
"version": "1.5.4",
55
"description": "Pipedream SDK",
66
"main": "./dist/server.js",
77
"module": "./dist/server.js",

packages/sdk/src/server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export class BackendClient extends BaseClient {
258258
let attempts = 0;
259259
const maxAttempts = 2;
260260

261-
while (!this.oauthAccessToken || this.oauthAccessToken.expiresAt - Date.now() <= 0) {
261+
while (!this.oauthAccessToken || this.oauthAccessToken.expiresAt - Date.now() < 1000) {
262262
if (attempts > maxAttempts) {
263263
throw new Error("ran out of attempts trying to retrieve oauth access token");
264264
}

pnpm-lock.yaml

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)