alyssaxuu/screenity · error · Error

drive_auth_failed

drive_auth_failed

Error message

User cancelled sign-in or failed to get token

What it means

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.

Source

Thrown at src/pages/Background/modules/signIn.js:63

        }

        // Save token to storage
        await new Promise((res) =>
          chrome.storage.local.set({ token }, () => res())
        );

        resolve(token);
      }
    );
  });
};

const signInChrome = async () => {
  const token = await chrome.identity.getAuthToken({ interactive: true });

  if (!token) {
    console.error("[Drive] drive_auth_failed: getAuthToken returned null");
    throw new Error("User cancelled sign-in or failed to get token");
  }

  // Save token to storage
  await new Promise((resolve) =>
    chrome.storage.local.set({ token: token.token }, () => resolve())
  );

  return token.token;
};

const signIn = async () => {
  try {
    if (isEdge) {
      return await signInEdge();
    } else {
      return await signInChrome();
    }
  } catch (error) {

View on GitHub (pinned to 512606387b)

Solutions

  1. Do not immediately auto-retry; the user may have explicitly cancelled — ask before re-prompting
  2. Check the OAuth client ID and manifest scopes against the Google Cloud console
  3. Clear cached auth tokens before retrying to avoid replaying a dead token
  4. Handle Edge's launchWebAuthFlow path where getAuthToken behaves differently
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/pages/Background/modules/signIn.js:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02). Data as JSON: /api/errors/a826738b183e2d55. Report an issue: GitHub.