{"record":{"id":"315670ed43c823b2","repo":"jackwener/OpenCLI","slug":"waiting-for-suno-clerk-session-client-cookie","errorCode":null,"errorMessage":"Waiting for Suno Clerk __session/__client cookie","messagePattern":"Waiting for Suno Clerk __session/__client cookie","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"warning","filePath":"clis/suno/auth.js","lineNumber":59,"sourceCode":"    }\n  })()`);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('suno.com', probe.detail);\n  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from clerk.suno.com`);\n  if (probe?.kind === 'exception') throw new CommandExecutionError(`Suno whoami failed: ${probe.detail}`);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Suno probe: ${JSON.stringify(probe)}`);\n  return { user_id: probe.user_id, name: probe.name };\n}\n\nregisterSiteAuthCommands({\n  site: 'suno',\n  domain: 'suno.com',\n  loginUrl: 'https://suno.com/?sign-in=true',\n  columns: ['user_id', 'name'],\n  quickCheck: hasSunoClerkCookie,\n  verify: verifySunoIdentity,\n  poll: async (page) => {\n    if (!await hasSunoClerkCookie(page)) {\n      throw new AuthRequiredError('suno.com', 'Waiting for Suno Clerk __session/__client cookie');\n    }\n    return verifySunoIdentity(page);\n  },\n});\n","sourceCodeStart":41,"sourceCodeEnd":64,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/auth.js#L41-L64","documentation":"During the interactive login flow, the poller repeatedly checks for the Clerk `__session` cookie to know when sign-in has finished. Each poll that runs before the cookie appears throws AuthRequiredError('suno.com', 'Waiting for Suno Clerk __session/__client cookie'); the auth framework treats this as 'not done yet' and keeps polling until you complete sign-in or the timeout expires.","triggerScenarios":"The login poll callback (registerSiteAuthCommands poll) fires while the user has not yet completed the Suno sign-in at https://suno.com/?sign-in=true, so hasSunoClerkCookie(page) is still false.","commonSituations":"User is slow entering credentials/2FA; login page left open without submitting; SSO redirect taking a while; user closed the login tab before finishing.","solutions":["Complete the sign-in in the opened browser window (including email code / 2FA)","Wait — the message is expected mid-login and clears once __session is set","If it loops forever, reload the login page and start sign-in again","Confirm no extension is blocking cookie writes for clerk.suno.com"],"exampleFix":"// no code fix needed — complete the interactive login\n// after sign-in the poll sees __session and calls verifySunoIdentity successfully\nawait cli('suno', 'login'); // finishes when cookie appears","handlingStrategy":"try-catch","validationCode":"const cookies = await page.getCookies({ url: 'https://clerk.suno.com' });\nconst loggedIn = cookies.some(c => c.name === '__session' && c.value);\nif (!loggedIn) console.log('Waiting for user to complete Suno sign-in...');","typeGuard":"function isLoginPendingError(e) {\n  return e instanceof Error && /Waiting for .* cookie/.test(e.message);\n}","tryCatchPattern":"try {\n  await pollLogin(page);\n} catch (e) {\n  if (isLoginPendingError(e)) return { pending: true }; // keep polling; expected mid-login\n  throw e;\n}","preventionTips":["Treat this message as normal progress during interactive login — don't abort","Complete sign-in promptly (including 2FA) to stay within the poll timeout","Keep the login tab focused and don't close it mid-flow","Ensure cookies aren't blocked for clerk.suno.com in the automation profile"],"tags":["auth","login-flow","clerk","polling"],"backgroundTag":"auth-login-pending","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}