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

Function handleCodexDeviceLogin

packages/arctic/src/cli/cmd/auth.ts:243–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241}
242
243async function handleCodexDeviceLogin() {
244 const check = await checkExistingConnection("codex")
245 if (!check.proceed) {
246 prompts.outro("Cancelled")
247 return
248 }
249
250 prompts.log.info("Authorize Codex with your ChatGPT subscription via device login.")
251 try {
252 await CodexClient.login()
253
254 const codexAuth = await Auth.get("codex")
255 if (codexAuth) {
256 const authKey = check.connectionName ? Auth.formatKey("codex", check.connectionName) : "codex"
257 if (authKey !== "codex") {
258 await Auth.set(authKey, codexAuth)
259 await Auth.remove("codex")
260 }
261 }
262
263 prompts.log.success("Codex login successful")
264 prompts.outro("Done")
265 } catch (error) {
266 const message = error instanceof Error ? error.message : String(error)
267 prompts.log.error(`Codex login failed: ${message}`)
268 throw error
269 }
270}
271
272interface OllamaModel {
273 id: string

Callers 1

fnFunction · 0.85

Calls 4

checkExistingConnectionFunction · 0.70
getMethod · 0.45
setMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected