{"record":{"id":"0fbadcd00a0094a5","repo":"jackwener/OpenCLI","slug":"upwork-redirected-to-login-open-https-www-upwor","errorCode":null,"errorMessage":"Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.","messagePattern":"Upwork redirected to login\\. Open https://www\\.upwork\\.com in the connected browser and sign in, then retry\\.","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/upwork/detail.js","lineNumber":83,"sourceCode":"                if (!ready) {\n                    return { ready, onLogin, challenge, job: null, buyer: null };\n                }\n                const s = window.$nuxt.$store.state.jobDetails;\n                return {\n                    ready,\n                    onLogin,\n                    challenge,\n                    job: s.job ? JSON.parse(JSON.stringify(s.job)) : null,\n                    buyer: s.buyer ? JSON.parse(JSON.stringify(s.buyer)) : null,\n                };\n            })()`));\n        }\n        catch (e) {\n            throw new CommandExecutionError(`Failed to read Upwork job-detail store: ${e?.message ?? e}`, 'The Vuex store was not reachable; try again after opening Upwork in the connected browser.');\n        }\n\n        if (payload?.onLogin) {\n            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');\n        }\n        if (payload?.challenge) {\n            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');\n        }\n        if (!isPlainObject(payload)) {\n            throw new CommandExecutionError('Upwork detail returned an unexpected Browser Bridge payload shape');\n        }\n        if (!payload?.ready || !payload.job) {\n            throw new EmptyResultError('upwork detail', `No Upwork job posting found for id \"${id}\" (may be closed, expired, or private)`);\n        }\n        if (!isPlainObject(payload.job)) {\n            throw new CommandExecutionError('Upwork job-detail store had an unexpected job shape; expected an object.');\n        }\n\n        const job = payload.job;\n        const returnedCiphertext = String(job?.ciphertext ?? '').trim();\n        if (returnedCiphertext && returnedCiphertext !== id) {\n            throw new CommandExecutionError(`Upwork job-detail store returned ciphertext \"${returnedCiphertext}\" while reading \"${id}\".`);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/upwork/detail.js#L65-L101","documentation":"After reading the Vuex store, the payload's onLogin flag indicates Upwork served a login redirect instead of job content. The command throws AuthRequiredError instructing the user to sign in via the connected browser, since authenticated job data can't be fetched anonymously.","triggerScenarios":"Fetching an Upwork job detail while the browser session is unauthenticated or expired: the store probe returns with onLogin truthy because the SPA redirected to /ab/account-security/login or equivalent.","commonSituations":"Session expired between commands; private/job-posting pages that require login; cookies cleared by the browser or an extension; running against a job URL while logged out in the connected profile.","solutions":["Open https://www.upwork.com in the connected browser and sign in, then re-run the detail command.","Use the library's upwork login flow to establish a fresh session.","Verify session cookies exist (master_access_token or XSRF-TOKEN + user_uid) before fetching.","If you are logged in but still redirected, log out and back in to refresh stale tokens."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const cookies = await page.cookies('https://www.upwork.com');\nif (!hasUpworkSessionCookie(cookies)) {\n  throw new Error('Authenticate first: open https://www.upwork.com and sign in');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const detail = await fetchUpworkJobDetail(id);\n} catch (e) {\n  if (e instanceof AuthRequiredError) {\n    await runInteractiveLogin(page); // or prompt user to sign in manually\n    return fetchUpworkJobDetail(id);\n  }\n  throw e;\n}","preventionTips":["Verify Upwork session cookies exist before running detail fetches.","Refresh the session when commands span long periods — sessions expire mid-run.","Use the library's login flow rather than relying on leftover browser state.","Catch AuthRequiredError centrally and route to your login routine."],"tags":["auth","upwork","login-redirect"],"backgroundTag":"login-redirect-detected","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}