{"record":{"id":"8486337463d9a35e","repo":"eyaltoledano/claude-task-master","slug":"invalid-response","errorCode":"INVALID_RESPONSE","errorMessage":"'Failed to get user information'","messagePattern":"'Failed to get user information'","errorType":"exception","errorClass":"AuthenticationError","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/auth/services/session-manager.ts","lineNumber":244,"sourceCode":"\t\tawait this.waitForInitialization();\n\t\ttry {\n\t\t\tthis.logger.info('Authenticating with one-time token...');\n\n\t\t\t// Verify the token and get session from Supabase\n\t\t\tconst session = await this.supabaseClient.verifyOneTimeCode(token);\n\n\t\t\tif (!session || !session.access_token) {\n\t\t\t\tthrow new AuthenticationError(\n\t\t\t\t\t'Failed to obtain access token from token',\n\t\t\t\t\t'NO_TOKEN'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Get user information\n\t\t\tconst user = await this.supabaseClient.getUser();\n\n\t\t\tif (!user) {\n\t\t\t\tthrow new AuthenticationError(\n\t\t\t\t\t'Failed to get user information',\n\t\t\t\t\t'INVALID_RESPONSE'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check if MFA is required for this user\n\t\t\tconst mfaCheck = await this.supabaseClient.checkMFARequired();\n\n\t\t\tif (mfaCheck.required && mfaCheck.factorId && mfaCheck.factorType) {\n\t\t\t\t// MFA is required - throw an error with the MFA challenge information\n\t\t\t\tthrow new AuthenticationError(\n\t\t\t\t\t'MFA verification required. Please provide your authentication code.',\n\t\t\t\t\t'MFA_REQUIRED',\n\t\t\t\t\tundefined,\n\t\t\t\t\t{\n\t\t\t\t\t\tfactorId: mfaCheck.factorId,\n\t\t\t\t\t\tfactorType: mfaCheck.factorType\n\t\t\t\t\t}","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/auth/services/session-manager.ts#L226-L262","documentation":"AuthenticationError with code INVALID_RESPONSE thrown by authenticateWithCode when supabaseClient.getUser() returns null even though a session was obtained. The one-time token produced a session but the user profile could not be fetched, so the library treats the auth response as incomplete and refuses to continue.","triggerScenarios":"Calling authenticateWithCode(token) where the session validates but the subsequent getUser() call fails to resolve a user: deleted/soft-deleted user, auth admin API failure, session not yet propagated, or network error swallowed into a null return by the client wrapper.","commonSituations":"User removed from the Supabase auth project after the token was issued; Supabase service interruption between token verification and user fetch; staging token used against a project where the user doesn't exist.","solutions":["Retry the authentication once — the failure can be transient between the two Supabase calls","Confirm the user account still exists in the Supabase project","Check network connectivity and Supabase status","Generate a new one-time token and retry the whole flow"],"exampleFix":"// before\nawait sessionManager.authenticateWithCode(token);\n// after: retry once on INVALID_RESPONSE\ntry {\n  await sessionManager.authenticateWithCode(token);\n} catch (e) {\n  if (e instanceof AuthenticationError && e.code === 'INVALID_RESPONSE') {\n    await sessionManager.authenticateWithCode(token); // one retry\n  }\n}","handlingStrategy":"retry","validationCode":"// confirm the user exists before token auth\n// e.g. check the account is active in the Supabase dashboard/admin API before running CLI login","typeGuard":"function isInvalidResponse(e: unknown): e is AuthenticationError {\n  return e instanceof AuthenticationError && e.code === 'INVALID_RESPONSE';\n}","tryCatchPattern":"try {\n  await sessionManager.authenticateWithCode(token);\n} catch (e) {\n  if (isInvalidResponse(e)) {\n    await delay(1000);\n    await sessionManager.authenticateWithCode(token); // single retry\n  } else throw e;\n}","preventionTips":["Confirm the user account exists in the target Supabase project before issuing tokens","Use tokens from the same environment (staging token → staging project)","Retry once automatically — the session/user fetch is two separate calls","Monitor Supabase status for auth API incidents"],"tags":["auth","supabase","invalid-response","user-profile"],"backgroundTag":"invalid-auth-response","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}