import { useEffect, useState } from 'react' import { IconChevronRight, IconCopy, IconCheck, IconCircleNumber1, IconCircleNumber2, IconCircleNumber3 } from '@tabler/icons-react' import { buttonVariants } from '@/client/components/ui/button' import { cn } from '@/client/lib/cn' type DeviceLoginStepsProps = { code: string url: string className?: string } export function DeviceLoginSteps({ code, url, className }: DeviceLoginStepsProps) { const [copied, setCopied] = useState(false) useEffect(() => { if (!copied) return const timer = setTimeout(() => setCopied(false), 3000) return () => clearTimeout(timer) }, [copied]) const copyCode = () => { navigator.clipboard ?.writeText(code) .then(() => setCopied(true)) .catch(() => {}) } return (
Enable device code sign-in for Codex in ChatGPT settings
Settings Security and loginCopy the one-time device code provided below
{code}
Log in to ChatGPT, paste the code, then come back to Moi
Open ChatGPT