Skip to content

Commit e927cf7

Browse files
authored
chore: fix local login flow where detecting machine ID is having ts-node interopt issues when loading the machine-id library (#32727)
1 parent a2adeab commit e927cf7

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/server/lib/cloud/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as RequestErrors from '@cypress/request-promise/errors'
88

99
import pkg from '@packages/root'
1010

11-
import * as machineId from '../machine_id'
11+
import { machineId } from '../machine_id'
1212
import * as errors from '../../errors'
1313

1414
import Bluebird from 'bluebird'
@@ -607,7 +607,7 @@ export default {
607607
postLogout (authToken) {
608608
return Bluebird.join(
609609
this.getAuthUrls(),
610-
machineId.machineId(),
610+
machineId(),
611611
(urls, machineId) => {
612612
return rp.post({
613613
url: urls.dashboardLogoutUrl,
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import nmi from 'node-machine-id'
1+
import { machineId as nodeMachineId } from 'node-machine-id'
22

3-
export function machineId () {
4-
return nmi.machineId()
5-
.catch(() => {
3+
export async function machineId () {
4+
try {
5+
const machineId = await nodeMachineId()
6+
7+
return machineId
8+
} catch (error) {
69
return null
7-
})
10+
}
811
}

0 commit comments

Comments
 (0)