jackwener/OpenCLI · error · AuthRequiredError
coupang.com
Error message
coupang.com
What it means
AuthRequiredError('coupang.com') thrown by verifyCoupangIdentity when the attached Chrome page has none of the required Coupang session cookies (AID, MEMBER_ID, LMSESSIONID with non-empty values) for https://www.coupang.com. Identity verification cannot proceed without a logged-in session.
Source
Thrown at clis/coupang/auth.js:11
import { AuthRequiredError, CommandExecutionError } from '@jackwener/opencli/errors';
import { registerSiteAuthCommands } from '../_shared/site-auth.js';
async function hasCoupangSessionCookie(page) {
const cookies = await page.getCookies({ url: 'https://www.coupang.com' });
return cookies.some(c => /^(AID|MEMBER_ID|LMSESSIONID)$/.test(c.name) && c.value);
}
async function verifyCoupangIdentity(page) {
if (!await hasCoupangSessionCookie(page)) {
throw new AuthRequiredError('coupang.com', 'Coupang session cookies (AID/MEMBER_ID/LMSESSIONID) missing');
}
await page.goto('https://www.coupang.com/np/mypage');
await page.wait(3);
const probe = await page.evaluate(`
(() => {
if (/login\\.coupang\\.com\\/login/.test(location.href)) {
return { kind: 'auth', detail: 'Coupang mypage redirected to login — anonymous' };
}
if (/Access Denied/i.test(document.title)) {
return { kind: 'auth', detail: 'Coupang Access Denied — anti-bot or non-KR IP' };
}
const el = document.querySelector('.my-nickname, .member-name, .mp-user-info-name, [class*=memberName]');
const name = (el?.textContent || '').trim();
if (!name) {
return { kind: 'auth', detail: 'Coupang mypage 200 but no member-name surface' };
}
return { ok: true, name };
})()View on GitHub (pinned to 49907e53dc)
Solutions
- Run coupang auth login coupang and complete login at https://login.coupang.com/login/login.pang in the controlled Chrome
- Confirm the Chrome profile/user-data-dir passed to the CLI is the one containing your Coupang session
- Check cookies for https://www.coupang.com manually (DevTools → Application → Cookies) for AID/MEMBER_ID/LMSESSIONID
- If the session was invalidated server-side, log in again — no client fix exists
Example fix
// before coupang auth verify coupang # AuthRequiredError: session cookies missing // after coupang auth login coupang coupang auth verify coupang
Defensive patterns
Strategy: try-catch
Validate before calling
const cookies = await page.getCookies({ url: 'https://www.coupang.com' });
const hasSession = cookies.some(c => /^(AID|MEMBER_ID|LMSESSIONID)$/.test(c.name) && c.value);
if (!hasSession) {
throw new Error('Coupang session missing — run coupang auth login coupang first');
} Type guard
function hasCoupangSession(cookies) {
return Array.isArray(cookies) && cookies.some(
c => c && /^(AID|MEMBER_ID|LMSESSIONID)$/.test(c.name) && typeof c.value === 'string' && c.value.length > 0
);
} Try / catch
try {
const identity = await coupangVerify(page);
} catch (err) {
if (err instanceof AuthRequiredError) {
await coupangLogin(page); // interactive login flow
return coupangVerify(page);
}
throw err;
} Prevention
- Run auth login before any session-dependent command
- Pin the correct Chrome user-data-dir so cookies persist between runs
- Re-login after Coupang forces logout (password change, server-side session invalidation)
When it happens
Trigger: Running coupang auth verify (or any flow calling verify) before logging in; the page.getCookies call returns no matching session cookies because the profile was never logged in or the session expired.
Common situations: Freshly launched Chrome profile with empty cookies; Coupang invalidated sessions server-side (forced logout, password change); cookies cleared by browser cleanup tooling; checking the wrong profile/user-data-dir.
Related errors
- 12306 tk auth cookie missing
- amazon.com
- Bilibili ${label} API requires login or permission: ${messag
- Boss wt2 / t cookies missing
- Waiting for Boss wt2 / t cookies
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ca646497e7353f4e.
Report an issue: GitHub.