{"record":{"id":"b37b11ecea524127","repo":"toeverything/AFFiNE","slug":"invalid-hashcash-challenge","errorCode":null,"errorMessage":"Invalid Hashcash challenge","messagePattern":"Invalid Hashcash challenge","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/cloud/services/captcha.ts","lineNumber":68,"sourceCode":"          siteKey?: string;\n          action?: string;\n        };\n        if (data.provider === 'turnstile') {\n          if (!data.siteKey || !data.action) {\n            throw new Error('Invalid Turnstile configuration');\n          }\n          return {\n            provider: data.provider,\n            turnstile: { siteKey: data.siteKey, action: data.action },\n          };\n        }\n        if (\n          data.provider !== 'hashcash' ||\n          !data.challenge ||\n          !data.resource ||\n          !this.validatorProvider\n        ) {\n          throw new Error('Invalid Hashcash challenge');\n        }\n        const token = await this.validatorProvider.validate(\n          data.challenge,\n          data.resource\n        );\n        return {\n          provider: data.provider,\n          token,\n          challenge: data.challenge,\n        };\n      }).pipe(\n        tap(({ challenge, provider, token, turnstile }) => {\n          this.provider$.next(provider);\n          this.turnstile$.next(turnstile);\n          this.verifyToken$.next(token);\n          this.challenge$.next(challenge);\n          if (token) this.resetAfter5min();\n        }),","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/cloud/services/captcha.ts#L50-L86","documentation":"Thrown in CaptchaService's revalidate effect when the captcha endpoint returns a non-hashcash provider or hashcash without challenge/resource, or no validator provider is registered locally — a hashcash challenge cannot be computed for the next auth request.","triggerScenarios":"Thrown in the captcha service when the provider is not hashcash, or the challenge/resource fields are missing, or no hashcash validatorProvider is registered.","commonSituations":"Appears when captcha validation cannot run, e.g. bad server challenge response or missing validator on the client. Retry sign-in; check server captcha setup.","solutions":["Request a fresh Hashcash challenge and retry.","Ensure the challenge payload is passed unmodified to the solver."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}