{"record":{"id":"3c257140e55f3fff","repo":"eyaltoledano/claude-task-master","slug":"please-run-task-master-auth-login","errorCode":null,"errorMessage":"Please run: task-master auth login","messagePattern":"Please run: task-master auth login","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/tm-core/src/modules/auth/services/session-manager.ts","lineNumber":92,"sourceCode":"\t * Called once during SessionManager initialization\n\t */\n\tprivate async migrateLegacyAuth(): Promise<void> {\n\t\tif (!fs.existsSync(this.LEGACY_AUTH_FILE)) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// Check if we have a valid Supabase session (don't use hasValidSession to avoid circular wait)\n\t\t\tconst session = await this.supabaseClient.getSession();\n\t\t\tif (session) {\n\t\t\t\tfs.unlinkSync(this.LEGACY_AUTH_FILE);\n\t\t\t\tthis.logger.info('Migrated to Supabase auth, removed legacy auth.json');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, user needs to re-authenticate\n\t\t\tthis.logger.warn('Legacy auth.json found but no valid Supabase session.');\n\t\t\tthis.logger.warn('Please run: task-master auth login');\n\t\t} catch (error) {\n\t\t\tthis.logger.debug('Error during legacy auth migration:', error);\n\t\t}\n\t}\n\n\t// ========== Session State ==========\n\n\t/**\n\t * Check if valid Supabase session exists\n\t * @returns true if a valid session exists\n\t */\n\tasync hasValidSession(): Promise<boolean> {\n\t\tawait this.waitForInitialization();\n\t\ttry {\n\t\t\tconst session = await this.supabaseClient.getSession();\n\t\t\treturn session != null;\n\t\t} catch {\n\t\t\treturn false;","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/auth/services/session-manager.ts#L74-L110","documentation":"SessionManager.migrateLegacyAuth logs this guidance when it finds a legacy auth.json but cannot find a valid Supabase session to migrate — the user's old token exists but no valid modern session does. It is a warning, not a thrown error; the caller (initialize) proceeds unauthenticated and later calls will fail auth checks.","triggerScenarios":"Running any authenticated command after upgrading from the legacy auth format when the legacy token is expired, invalid, or was never linked to a Supabase account — so migration cannot complete.","commonSituations":"Upgrading task-master CLI across the Supabase auth migration; legacy token expired while the machine was offline; switching accounts; partial auth.json after a failed install.","solutions":["Run `task-master auth login` to authenticate with the new Supabase flow","Delete the stale legacy auth.json manually if login keeps failing, then log in again","Verify you are using the same account/email that held the legacy session"],"exampleFix":"// before\n$ task-master list\n// Please run: task-master auth login\n// after\n$ task-master auth login\n$ task-master list  # works","handlingStrategy":"validation","validationCode":"import { existsSync, readFileSync } from 'fs';\nif (existsSync(legacyPath)) {\n  const legacy = JSON.parse(readFileSync(legacyPath, 'utf8'));\n  if (!legacy?.token) console.warn('Legacy auth.json has no token; run: task-master auth login');\n}","typeGuard":"function hasValidLegacyAuth(auth) {\n  return !!auth && typeof auth.token === 'string' && auth.token.length > 0;\n}","tryCatchPattern":"try {\n  await sessionManager.initialize();\n} catch (error) {\n  if (/task-master auth login/.test(error.message ?? '')) {\n    console.error('Not authenticated. Run: task-master auth login');\n  } else throw error;\n}","preventionTips":["Run `task-master auth login` once after upgrading past the legacy auth version","Remove stale auth.json before re-authenticating","Confirm you log in with the same email as the legacy session","Re-authenticate after long offline periods when sessions expire"],"tags":["authentication","migration","session","supabase"],"backgroundTag":"stale-auth-token","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}