{"record":{"id":"4fcf8a6a7e4b5ee2","repo":"jackwener/OpenCLI","slug":"1point3acres-discuz-auth-cookie-missing","errorCode":null,"errorMessage":"1point3acres Discuz *_auth cookie missing","messagePattern":"1point3acres Discuz \\*_auth cookie missing","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/1point3acres/auth.js","lineNumber":37,"sourceCode":"          kind: hasLoggedInMenu ? 'shape' : 'auth',\n          detail: hasLoggedInMenu\n            ? '1point3acres bbs rendered logged-in menus but no identity link'\n            : '1point3acres bbs rendered but no logged-in identity',\n        };\n      }\n      return { ok: true, user_id: uid, username };\n    })()\n  `;\n\nasync function has1Point3AcresAuthCookie(page) {\n  const host = await page.getCookies({ url: 'https://www.1point3acres.com' });\n  const root = await page.getCookies({ url: 'https://.1point3acres.com' });\n  return [...host, ...root].some(c => /_auth$/.test(c.name) && c.value);\n}\n\nasync function verify1Point3AcresIdentity(page) {\n  if (!await has1Point3AcresAuthCookie(page)) {\n    throw new AuthRequiredError('1point3acres.com', '1point3acres Discuz *_auth cookie missing');\n  }\n  await page.goto('https://www.1point3acres.com/bbs/');\n  await page.wait(2);\n  const probe = await page.evaluate(IDENTITY_PROBE_JS);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('1point3acres.com', probe.detail);\n  if (probe?.kind === 'shape') throw new CommandExecutionError(probe.detail);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected 1point3acres probe: ${JSON.stringify(probe)}`);\n  return { user_id: probe.user_id, username: probe.username };\n}\n\nregisterSiteAuthCommands({\n  site: '1point3acres',\n  domain: '1point3acres.com',\n  loginUrl: 'https://auth.1point3acres.com/login',\n  columns: ['user_id', 'username'],\n  quickCheck: has1Point3AcresAuthCookie,\n  verify: verify1Point3AcresIdentity,\n  poll: async (page) => {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/1point3acres/auth.js#L19-L55","documentation":"verify1Point3AcresIdentity requires a Discuz *_auth cookie for 1point3acres.com in the shared Chrome profile; if has1Point3AcresAuthCookie finds none it throws AuthRequiredError. The Discuz _auth cookie is what proves you are logged in to the forum, so without it the library cannot scrape authenticated pages and fails immediately with the missing-prerequisite message.","triggerScenarios":"Calling the 1point3acres flow when the browser attached via CDP has no *_auth cookie for https://.1point3acres.com — never logged in, logged out, cookies cleared, or attached to the wrong browser profile.","commonSituations":"Fresh Chrome profile without a 1point3acres login; forum session expired and Discuz rotated/cleared cookies; cookie cleanup extensions or incognito profile wiping cookies; attaching CDP to a different Chrome instance than the one with the login.","solutions":["Log in to https://www.1point3acres.com/bbs/ in the shared Chrome instance so a *_auth cookie is set, then rerun the command.","Verify the CDP-attached browser is the same profile that holds the login (getCookies reads the attached browser's jar).","Check cookies are not being cleared on exit (disable 'clear cookies on close' / extensions) and that the domain cookie exists: document.cookie or DevTools → Application → Cookies → .1point3acres.com."],"exampleFix":"// before\n// shared Chrome never logged into 1point3acres\nopencli 1point3acres favorites // -> AuthRequiredError: *_auth cookie missing\n// after logging into the forum in shared Chrome\nopencli 1point3acres favorites","handlingStrategy":"try-catch","validationCode":"// precheck for the Discuz auth cookie before running the flow\nconst cookies = await page.getCookies({ url: 'https://.1point3acres.com' });\nconst hasAuth = cookies.some(c => /_auth$/.test(c.name) && c.value);\nif (!hasAuth) throw new Error('Log into 1point3acres.com/bbs in shared Chrome first');","typeGuard":"function hasDiscuzAuthCookie(cookies) {\n  return Array.isArray(cookies) && cookies.some(c => /_auth$/.test(c.name) && typeof c.value === 'string' && c.value.length > 0);\n}","tryCatchPattern":"try {\n  await run1Point3AcresCommand();\n} catch (e) {\n  if (e instanceof AuthRequiredError) {\n    console.error('1point3acres login required: open the forum in shared Chrome and log in so a *_auth cookie is set.');\n  } else throw e;\n}","preventionTips":["Log into 1point3acres.com/bbs in the same Chrome profile the CLI attaches to.","Ensure cookies persist (disable clear-on-exit and cookie-wiping extensions).","Re-check the cookie before long-running jobs; Discuz sessions expire.","Confirm CDP is attached to the logged-in browser instance, not a fresh profile."],"tags":["auth","cookies","discuz","login-required"],"backgroundTag":"auth-cookie-missing","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}