MCPcopy Create free account
hub / github.com/arctic-cli/interface / printDeviceCodePrompt

Function printDeviceCodePrompt

packages/arctic/src/auth/codex.ts:224–238  ·  view source on GitHub ↗
(code: string, verificationUrl = DEVICE_LOGIN_URL)

Source from the content-addressed store, hash-verified

222 }
223
224 export function printDeviceCodePrompt(code: string, verificationUrl = DEVICE_LOGIN_URL): void {
225 console.log(`
226Welcome to Codex
227
228Follow these steps to sign in with ChatGPT using device code authorization:
229
2301. Open this link in your browser and sign in to your account
231 ${verificationUrl}
232
2332. Enter this one-time code (expires in 15 minutes)
234 ${code}
235
236Device codes are a common phishing target. Never share this code.
237 `)
238 }
239
240 export async function pollForToken(deviceAuthId: string, userCode: string, interval: number): Promise<TokenResponse> {
241 const url = issuerPath("/api/accounts/deviceauth/token")

Callers 1

loginFunction · 0.85

Calls 1

logMethod · 0.45

Tested by

no test coverage detected