{"record":{"id":"381f2ff041def376","repo":"alyssaxuu/screenity","slug":"token-verify-failed-response-status","errorCode":null,"errorMessage":"Token verify failed (${response.status})","messagePattern":"Token verify failed \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/pages/Background/auth/loginWithWebsite.js","lineNumber":181,"sourceCode":"        cached: true,\n        instantMode: instantMode || false,\n      };\n    }\n\n    // fresh marker but missing user payload; force a verify call\n    await chrome.storage.local.set({ lastAuthCheck: 0 });\n  }\n\n  try {\n    const response = await fetchWithTimeout(`${API_BASE}/auth/verify`, {\n      headers: {\n        Authorization: `Bearer ${screenityToken}`,\n      },\n    });\n\n    if (!response.ok) {\n      isTokenInvalid = response.status === 401 || response.status === 403;\n      throw new Error(`Token verify failed (${response.status})`);\n    }\n\n    const responseData = await response.json();\n    const { subscribed, subscription, hasSubscribedBefore, ...user } =\n      responseData;\n\n    await chrome.storage.local.set({\n      screenityUser: user,\n      lastAuthCheck: now,\n      isLoggedIn: true,\n      wasLoggedIn: false,\n      stayLoggedOut: false,\n      isSubscribed: subscribed,\n      proSubscription: subscription,\n      hasSubscribedBefore: !!hasSubscribedBefore,\n      pushToTalk: false,\n      onboarding: false,\n      showProSplash: false,","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/alyssaxuu/screenity/blob/512606387b8d07dda5e63bb428bd063f0a2a3ed0/src/pages/Background/auth/loginWithWebsite.js#L163-L199","documentation":"The /auth/verify endpoint returned a non-OK HTTP status, so the stored Screenity token could not be confirmed. Thrown in loginWithWebsite when response.ok is false after calling the verify API with the Bearer token; 401/403 also set isTokenInvalid to trigger re-authentication.","triggerScenarios":"Thrown at src/pages/Background/auth/loginWithWebsite.js:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["On 401/403 treat the token as expired/revoked and force the user through re-authentication","Clear lastAuthCheck and retry once to rule out a stale cache marker","Log the response body for 5xx and surface a transient-network error with retry","Verify API_BASE and endpoint reachability from the extension context"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"512606387b8d07dda5e63bb428bd063f0a2a3ed0","analyzedAt":"2026-09-02T20:59:09.419Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}