diff --git a/packages/gensx-cli/src/commands/login.ts b/packages/gensx-cli/src/commands/login.ts index 0e9e84d3..8bed2fee 100644 --- a/packages/gensx-cli/src/commands/login.ts +++ b/packages/gensx-cli/src/commands/login.ts @@ -1,9 +1,10 @@ -import { createHash } from "crypto"; import { mkdir, writeFile } from "fs/promises"; import { homedir, platform } from "os"; import { hostname } from "os"; import path from "path"; +import { createHash, getRandomValues } from "node:crypto"; + import { consola } from "consola"; import { stringify as stringifyIni } from "ini"; import open from "open"; @@ -66,9 +67,7 @@ type DeviceAuthStatus = }; function generateVerificationCode(): string { - return Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString( - "base64url", - ); + return Buffer.from(getRandomValues(new Uint8Array(32))).toString("base64url"); } function createCodeHash(code: string): string {