{"record":{"id":"47fa64e23d5baaa4","repo":"gatsbyjs/gatsby","slug":"your-token-has-expired-you-may-need-to-login-agai","errorCode":null,"errorMessage":"Your token has expired, you may need to login again","messagePattern":"Your token has expired, you may need to login again","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-cli/src/util/manage-token.ts","lineNumber":12,"sourceCode":"import { getConfigStore } from \"gatsby-core-utils\"\nimport report from \"../reporter\"\n\nconst tokenKey = `cli.token`\nconst tokenExpirationKey = `cli.tokenExpiration`\n\nconst getExpiration = (): string => getConfigStore().get(tokenExpirationKey)\nexport const getToken = async (): Promise<string> => {\n  const expiration = await getExpiration()\n  const tokenHasExpired = new Date() > new Date(expiration)\n  if (tokenHasExpired) {\n    report.warn(`Your token has expired, you may need to login again`)\n  }\n  return getConfigStore().get(tokenKey)\n}\n\nexport const setToken = (token: string | null, expiration: string): void => {\n  const store = getConfigStore()\n\n  store.set(tokenKey, token)\n  // we would be able to decode an expiration off the JWT, but the auth service isn't set up to attach it to the token\n  store.set(tokenExpirationKey, expiration)\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-cli/src/util/manage-token.ts#L1-L24","documentation":"Warning from the CLI token manager: the stored Grafmeer/Telemetry login token's expiration timestamp is in the past. getToken still returns the (stale) token after warning; API calls requiring auth will fail until the user re-authenticates.","triggerScenarios":"Thrown at packages/gatsby-cli/src/util/manage-token.ts:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log in again with `gatsby login` to refresh the token"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}