{"record":{"id":"a826738b183e2d55","repo":"alyssaxuu/screenity","slug":"drive-auth-failed","errorCode":"drive_auth_failed","errorMessage":"User cancelled sign-in or failed to get token","messagePattern":"User cancelled sign-in or failed to get token","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/pages/Background/modules/signIn.js","lineNumber":63,"sourceCode":"        }\n\n        // Save token to storage\n        await new Promise((res) =>\n          chrome.storage.local.set({ token }, () => res())\n        );\n\n        resolve(token);\n      }\n    );\n  });\n};\n\nconst signInChrome = async () => {\n  const token = await chrome.identity.getAuthToken({ interactive: true });\n\n  if (!token) {\n    console.error(\"[Drive] drive_auth_failed: getAuthToken returned null\");\n    throw new Error(\"User cancelled sign-in or failed to get token\");\n  }\n\n  // Save token to storage\n  await new Promise((resolve) =>\n    chrome.storage.local.set({ token: token.token }, () => resolve())\n  );\n\n  return token.token;\n};\n\nconst signIn = async () => {\n  try {\n    if (isEdge) {\n      return await signInEdge();\n    } else {\n      return await signInChrome();\n    }\n  } catch (error) {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/alyssaxuu/screenity/blob/512606387b8d07dda5e63bb428bd063f0a2a3ed0/src/pages/Background/modules/signIn.js#L45-L81","documentation":"chrome.identity.getAuthToken({interactive:true}) in signInChrome resolved to a null/falsy token — the user cancelled the Google sign-in dialog or the identity system failed to mint a token. Thrown so callers (signIn → Drive save) know no token exists to store.","triggerScenarios":"Thrown at src/pages/Background/modules/signIn.js:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not immediately auto-retry; the user may have explicitly cancelled — ask before re-prompting","Check the OAuth client ID and manifest scopes against the Google Cloud console","Clear cached auth tokens before retrying to avoid replaying a dead token","Handle Edge's launchWebAuthFlow path where getAuthToken behaves differently"],"exampleFix":null,"handlingStrategy":"try-catch","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"}