{"record":{"id":"a6f2871eeb80bda0","repo":"toeverything/AFFiNE","slug":"invalid-email","errorCode":"invalid_email","errorMessage":"An invalid email provided: not provided","messagePattern":"An invalid email provided: not provided","errorType":"validation","errorClass":"InvalidEmail","httpStatus":400,"severity":"error","filePath":"packages/backend/server/src/core/auth/controller.ts","lineNumber":92,"sourceCode":"    private readonly authSessions: AuthSessionService\n  ) {\n    if (env.dev) {\n      // set DNS servers in dev mode\n      // NOTE: some network debugging software uses DNS hijacking\n      // to better debug traffic, but their DNS servers may not\n      // handle the non dns query(like txt, mx) correctly, so we\n      // set a public DNS server here to avoid this issue.\n      setServers(['1.1.1.1', '8.8.8.8']);\n    }\n  }\n\n  @Public()\n  @UseNamedGuard('version')\n  @Post('/preflight')\n  async preflight(@Body() body?: unknown): Promise<PreflightResponse> {\n    const input = AuthPreflightBodySchema.safeParse(body);\n    if (!input.success) {\n      throw new InvalidEmail({ email: 'not provided' });\n    }\n    validators.assertValidEmail(input.data.email);\n\n    try {\n      return await this.runtime.executeAuthSessionCommandV1<PreflightResponse>({\n        action: 'login_preflight',\n        email: input.data.email,\n      });\n    } catch (error) {\n      if (String(error).includes('email_domain_verification_unavailable')) {\n        throw new NetworkError();\n      }\n      throw error;\n    }\n  }\n\n  @UseNamedGuard('version')\n  @Get('/methods')","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/2af30773aecd567f09b346e7b72fc69143144057/packages/backend/server/src/core/auth/controller.ts#L74-L110","documentation":"Sentinel message produced by the auth preflight validation when the submitted email field fails validation — the schema parse or email validator reports an invalid address, and 'not provided' is the placeholder when no email was sent at all. The request is rejected with an invalid-argument style error before any account lookup happens.","triggerScenarios":"Thrown at packages/backend/server/src/core/auth/controller.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide an email address in the request body — the sign-in/sign-up call was made with an empty or missing email field.","Validate the email client-side (non-empty, RFC format) before submitting to avoid this round trip."],"exampleFix":"if (!email || !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) {\n  setError('Please enter a valid email');\n  return;\n}\nawait signIn({ email });","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2af30773aecd567f09b346e7b72fc69143144057","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}