Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion services/actions/src/auth/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ export default async function tokenHandler(req, res) {
return { accessToken: freshJwt, workosAccessToken: refreshResult.accessToken };
})();
inflightRefreshes.set(sessionId, refreshPromise);
refreshPromise.finally(() => inflightRefreshes.delete(sessionId));
// Swallow the rejection on this branch — `await refreshPromise` below owns the error.
// Without the catch, `.finally()` returns an unhandled rejected promise when refresh fails,
// which crashes the process via unhandledRejection.
refreshPromise
.finally(() => inflightRefreshes.delete(sessionId))
.catch(() => {});
}

try {
Expand Down
Loading