{"record":{"id":"a533cc3448b96d4f","repo":"jackwener/OpenCLI","slug":"auth-a533cc","errorCode":null,"errorMessage":"auth","messagePattern":"auth","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/coupang/auth.js","lineNumber":31,"sourceCode":"  await page.goto('https://www.coupang.com/np/mypage');\n  await page.wait(3);\n  const probe = await page.evaluate(`\n    (() => {\n      if (/login\\\\.coupang\\\\.com\\\\/login/.test(location.href)) {\n        return { kind: 'auth', detail: 'Coupang mypage redirected to login — anonymous' };\n      }\n      if (/Access Denied/i.test(document.title)) {\n        return { kind: 'auth', detail: 'Coupang Access Denied — anti-bot or non-KR IP' };\n      }\n      const el = document.querySelector('.my-nickname, .member-name, .mp-user-info-name, [class*=memberName]');\n      const name = (el?.textContent || '').trim();\n      if (!name) {\n        return { kind: 'auth', detail: 'Coupang mypage 200 but no member-name surface' };\n      }\n      return { ok: true, name };\n    })()\n  `);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('coupang.com', probe.detail);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Coupang probe: ${JSON.stringify(probe)}`);\n  return { name: probe.name };\n}\n\nregisterSiteAuthCommands({\n  site: 'coupang',\n  domain: 'coupang.com',\n  loginUrl: 'https://login.coupang.com/login/login.pang',\n  columns: ['name'],\n  verify: verifyCoupangIdentity,\n  poll: async (page) => {\n    if (!await hasCoupangSessionCookie(page)) {\n      throw new AuthRequiredError('coupang.com', 'Waiting for Coupang session cookies');\n    }\n    return verifyCoupangIdentity(page);\n  },\n});\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/coupang/auth.js#L13-L49","documentation":"AuthRequiredError('coupang.com') thrown by verifyCoupangIdentity when the in-page probe of https://www.coupang.com/np/mypage reports kind 'auth'. This happens when mypage redirects to login.coupang.com/login (anonymous session despite cookies), Coupang returns 'Access Denied' (anti-bot or non-KR IP), or the mypage loads with HTTP 200 but no member-name element is found. Any of these mean Coupang does not consider the session a valid logged-in member.","triggerScenarios":"Session cookies exist but are expired/invalid so mypage redirects to login; anti-bot 'Access Denied' page; mypage markup changed and selectors (.my-nickname, .member-name, .mp-user-info-name, [class*=memberName]) match nothing.","commonSituations":"Running verification from a datacenter/non-KR IP triggering Coupang's geo/anti-bot block; stale cookies passing the cookie check but rejected server-side; Coupang redesign changing nickname element classes; headless fingerprint detected.","solutions":["Re-login in the controlled Chrome (coupang auth login coupang) to refresh the session","Check the probe.detail in the error: 'redirected to login' → re-login; 'Access Denied' → use a KR/residential IP or slower polling; 'no member-name surface' → update the name selectors to match current mypage markup","Avoid datacenter IPs and headless flags that trip Coupang anti-bot","Wait and retry if the block is transient rate-limiting"],"exampleFix":"// before\n coupang auth verify coupang  # AuthRequiredError: Access Denied — anti-bot or non-KR IP\n// after\n # route Chrome through a KR residential proxy, then\n coupang auth verify coupang","handlingStrategy":"try-catch","validationCode":"// probe mypage reachability before verify\nconst res = await fetch('https://www.coupang.com/np/mypage', { redirect: 'manual' });\nif (res.status === 403 || /Access Denied/i.test(await res.text().catch(() => ''))) {\n  throw new Error('Coupang blocking this IP — use a KR/residential proxy');\n}","typeGuard":"function isAuthProbe(probe) {\n  return probe != null && typeof probe === 'object' &&\n    probe.kind === 'auth' && typeof probe.detail === 'string';\n}","tryCatchPattern":"try {\n  const identity = await coupangVerify(page);\n} catch (err) {\n  if (err instanceof AuthRequiredError) {\n    if (/Access Denied/.test(err.message)) {\n      proxy.rotateToKRResidential();  // geo/anti-bot block\n    } else {\n      await coupangLogin(page);       // redirected to login\n    }\n    return coupangVerify(page);\n  }\n  throw err;\n}","preventionTips":["Use residential/KR IPs; avoid datacenter ranges that trip Coupang anti-bot","Re-login when cookies pass the check but the server rejects the session","Monitor Coupang mypage markup; update name selectors when classes change","Avoid headless browser flags that raise bot-detection scores"],"tags":["authentication","anti-bot","coupang","geo-blocking"],"backgroundTag":"site-auth-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}