{"record":{"id":"ad7b1692b74f61d5","repo":"jackwener/OpenCLI","slug":"dribbble-session-cookies-are-missing","errorCode":null,"errorMessage":"Dribbble session cookies are missing","messagePattern":"Dribbble session cookies are missing","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/dribbble/auth.js","lineNumber":7,"sourceCode":"import { AuthRequiredError, CommandExecutionError } from '@jackwener/opencli/errors';\nimport { registerSiteAuthCommands } from '../_shared/site-auth.js';\nimport { DRIBBBLE_HOST, DRIBBBLE_ORIGIN, hasDribbbleSessionCookie } from './utils.js';\n\nasync function verifyDribbbleIdentity(page) {\n    if (!await hasDribbbleSessionCookie(page)) {\n        throw new AuthRequiredError(DRIBBBLE_HOST, 'Dribbble session cookies are missing');\n    }\n    await page.goto(DRIBBBLE_ORIGIN);\n    // Dribbble serves an AWS WAF challenge before the real document on fresh\n    // tabs. Three seconds is not enough consistently; probing early turns a\n    // valid session into a false AUTH_REQUIRED result.\n    await page.wait(5);\n    const result = await page.evaluate(`(() => {\n        const profile = document.querySelector('a[title=\"Open profile\"]');\n        const signOut = document.querySelector('form[action$=\"/session\"] input[name=\"_method\"][value=\"delete\"]');\n        const href = profile?.getAttribute('href') || '';\n        if (!signOut || !/^\\\\/[^/]+$/.test(href)) {\n            return { kind: 'auth', detail: 'Dribbble header does not show a logged-in profile' };\n        }\n        return {\n            ok: true,\n            username: href.slice(1),\n            profile_url: new URL(href, location.href).href,\n        };","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dribbble/auth.js#L1-L25","documentation":"An AuthRequiredError raised by verifyDribbbleIdentity when the browser context has no Dribbble session cookie (hasDribbbleSessionCookie is false). The dribbble auth command requires an authenticated session cookie before it will even open the site to verify the identity, because Dribbble serves an AWS WAF challenge and identity checks are meaningless without login state.","triggerScenarios":"Calling `dribbble auth` (or any command triggering verifyDribbbleIdentity) before ever logging into dribbble.com in the managed browser, or after the browser profile/cookies were cleared or rotated to a fresh context.","commonSituations":"Fresh CI machine with no logged-in browser profile; cookie expiration after long inactivity; running with an incognito/temporary browser context; corporate cleanup wiping profile directories between runs.","solutions":["Log into dribbble.com inside the managed browser session, then re-run the command.","Re-run the site's login/auth setup step first (registerSiteAuthCommands provides the login flow).","Persist the browser profile/cookies between runs so the session survives restarts.","Verify cookie settings aren't blocking dribbble.com cookies (privacy settings or cookie purge extensions)."],"exampleFix":"// before: assuming a session exists\nawait run(['dribbble', 'auth']);\n// after: ensure login first, catch auth errors\nawait run(['dribbble', 'login']);\ntry {\n  await run(['dribbble', 'auth']);\n} catch (e) {\n  if (e.name === 'AuthRequiredError') throw new Error('Run dribbble login first');\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await run('dribbble auth');\n} catch (e) {\n  if (e.name === 'AuthRequiredError' && /cookies are missing/.test(e.message)) {\n    await run('dribbble login'); // establish a session first\n    return run('dribbble auth');\n  }\n  throw e;\n}","preventionTips":["Run the dribbble login flow before any authenticated command on fresh machines/CI.","Persist the browser profile directory so cookies survive restarts.","Check for the session cookie in your own setup script before scheduling auth-dependent jobs."],"tags":["auth-required","dribbble","session","cookies"],"backgroundTag":"auth-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}