{"record":{"id":"71710f22b8a8aee0","repo":"jackwener/OpenCLI","slug":"waiting-for-weibo-sub-subp-cookies","errorCode":null,"errorMessage":"Waiting for Weibo SUB / SUBP cookies","messagePattern":"Waiting for Weibo SUB / SUBP cookies","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"warning","filePath":"clis/weibo/auth.js","lineNumber":67,"sourceCode":"  if (result?.kind === 'exception') throw new CommandExecutionError(`Weibo whoami failed: ${result.detail}`);\n  if (!result || Array.isArray(result) || typeof result !== 'object') {\n    throw new CommandExecutionError('Weibo whoami returned malformed probe payload');\n  }\n  if (!result?.ok) throw new CommandExecutionError(`Unexpected Weibo probe: ${JSON.stringify(result)}`);\n  if (!result.user_id) throw new CommandExecutionError('Weibo whoami returned no user id');\n  return { user_id: result.user_id, screen_name: result.screen_name, profile_url: result.profile_url };\n}\n\nregisterSiteAuthCommands({\n  site: 'weibo',\n  domain: 'weibo.com',\n  loginUrl: 'https://weibo.com/login',\n  columns: ['user_id', 'screen_name', 'profile_url'],\n  quickCheck: hasWeiboSessionCookie,\n  verify: verifyWeiboIdentity,\n  poll: async (page) => {\n    if (!await hasWeiboSessionCookie(page)) {\n      throw new AuthRequiredError('weibo.com', 'Waiting for Weibo SUB / SUBP cookies');\n    }\n    return verifyWeiboIdentity(page);\n  },\n});\n\nexport const __test__ = { buildWeiboIdentityProbe, verifyWeiboIdentity };\n","sourceCodeStart":49,"sourceCodeEnd":74,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/auth.js#L49-L74","documentation":"During interactive login, the poll loop repeatedly checks whether the Weibo SUB/SUBP session cookies have been set. Until they appear, it throws AuthRequiredError with this message instead of running full identity verification. It signals 'login not finished yet', not a hard failure — the login flow keeps polling until timeout.","triggerScenarios":"The poll callback runs while the user has not completed QR-code/credential login, or login completed on a different browser context/profile than the one being polled, so the weibo.com domain cookies SUB and SUBP were never set.","commonSituations":"User scans the QR code too slowly (or not at all) during the login window, login is done in a different Chrome profile, cookies blocked by browser settings/extensions, or Weibo moved/renamed its session cookies.","solutions":["Complete the QR scan or credential login in the opened browser before the poll timeout","Confirm login happened in the same browser profile/context the CLI controls","Check that cookies are enabled and no extension blocks weibo.com cookies","Retry the login; if it persists, verify the session manually and reuse that browser profile"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// check session cookies before starting the interactive flow\nif (!(await hasWeiboSessionCookie(page))) {\n  console.log('Complete the Weibo login in the opened browser...');\n}","typeGuard":"function isAuthRequired(err) {\n  return err instanceof AuthRequiredError || /Waiting for Weibo SUB \\/ SUBP/.test(err.message);\n}","tryCatchPattern":"try {\n  identity = await pollWeiboLogin(page);\n} catch (err) {\n  if (isAuthRequired(err)) {\n    console.log('Login not detected yet — rescan the QR code or retry weibo login');\n  } else throw err;\n}","preventionTips":["Complete the QR scan promptly within the poll window","Always log in inside the browser window/profile the CLI opened","Ensure cookies are enabled and no extension blocks weibo.com cookies","Verify SUB/SUBP cookies exist (DevTools > Application > Cookies) if polls keep failing"],"tags":["weibo","authentication","login-polling"],"backgroundTag":"login-cookies-not-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}