Skip to content

Commit 2d00ab8

Browse files
authored
chore: fix hanging when there is no response (#2177)
1 parent a4f6b4e commit 2d00ab8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/cli/src/auth/device-flow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { blue, green } from 'colorette';
22
import * as childProcess from 'node:child_process';
33
import { logger } from '@redocly/openapi-core';
44
import { ReuniteApiClient } from '../reunite/api/api-client.js';
5+
import { DEFAULT_FETCH_TIMEOUT } from '../utils/fetch-with-timeout.js';
56

67
export type AuthToken = {
78
access_token: string;
@@ -167,6 +168,7 @@ export class RedoclyOAuthDeviceFlow {
167168
body: body ? JSON.stringify(body) : body,
168169
method,
169170
headers: { 'Content-Type': 'application/json', ...headers },
171+
timeout: DEFAULT_FETCH_TIMEOUT,
170172
});
171173
if (response.status === 204) {
172174
return { success: true };

0 commit comments

Comments
 (0)