jackwener/OpenCLI · error · AuthRequiredError

Dribbble session cookies are missing

Error message

Dribbble session cookies are missing

What it means

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.

Source

Thrown at clis/dribbble/auth.js:7

import { AuthRequiredError, CommandExecutionError } from '@jackwener/opencli/errors';
import { registerSiteAuthCommands } from '../_shared/site-auth.js';
import { DRIBBBLE_HOST, DRIBBBLE_ORIGIN, hasDribbbleSessionCookie } from './utils.js';

async function verifyDribbbleIdentity(page) {
    if (!await hasDribbbleSessionCookie(page)) {
        throw new AuthRequiredError(DRIBBBLE_HOST, 'Dribbble session cookies are missing');
    }
    await page.goto(DRIBBBLE_ORIGIN);
    // Dribbble serves an AWS WAF challenge before the real document on fresh
    // tabs. Three seconds is not enough consistently; probing early turns a
    // valid session into a false AUTH_REQUIRED result.
    await page.wait(5);
    const result = await page.evaluate(`(() => {
        const profile = document.querySelector('a[title="Open profile"]');
        const signOut = document.querySelector('form[action$="/session"] input[name="_method"][value="delete"]');
        const href = profile?.getAttribute('href') || '';
        if (!signOut || !/^\\/[^/]+$/.test(href)) {
            return { kind: 'auth', detail: 'Dribbble header does not show a logged-in profile' };
        }
        return {
            ok: true,
            username: href.slice(1),
            profile_url: new URL(href, location.href).href,
        };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Log into dribbble.com inside the managed browser session, then re-run the command.
  2. Re-run the site's login/auth setup step first (registerSiteAuthCommands provides the login flow).
  3. Persist the browser profile/cookies between runs so the session survives restarts.
  4. Verify cookie settings aren't blocking dribbble.com cookies (privacy settings or cookie purge extensions).

Example fix

// before: assuming a session exists
await run(['dribbble', 'auth']);
// after: ensure login first, catch auth errors
await run(['dribbble', 'login']);
try {
  await run(['dribbble', 'auth']);
} catch (e) {
  if (e.name === 'AuthRequiredError') throw new Error('Run dribbble login first');
  throw e;
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await run('dribbble auth');
} catch (e) {
  if (e.name === 'AuthRequiredError' && /cookies are missing/.test(e.message)) {
    await run('dribbble login'); // establish a session first
    return run('dribbble auth');
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/ad7b1692b74f61d5. Report an issue: GitHub.