toeverything/AFFiNE · error · Error

Failed to check user by email: ${email}

Error message

Failed to check user by email: ${email}

What it means

An HTTP-status guard in the auth store: checkUserByEmail POSTs to /api/auth/preflight and throws when the response is not ok. It fires when the preflight endpoint returns any non-2xx status (server error, rate limit, network-level failure); the interpolated email is the address being checked, not the cause — inspect the response status/network for the underlying reason.

Source

Thrown at packages/frontend/core/src/modules/cloud/stores/auth.ts:219

      variables: {
        input: {
          name: label,
        },
      },
    });
  }

  async checkUserByEmail(email: string) {
    const res = await this.fetchService.fetch('/api/auth/preflight', {
      method: 'POST',
      body: JSON.stringify({ email }),
      headers: {
        'content-type': 'application/json',
      },
    });

    if (!res.ok) {
      throw new Error(`Failed to check user by email: ${email}`);
    }

    const data = AuthPreflightResponseSchema.safeParse(await res.json());
    if (!data.success) {
      throw createUnsupportedServerVersionError(
        this.serverService.server.config$.value.version
      );
    }

    return data.data;
  }

  async deleteAccount() {
    const res = await this.gqlService.gql({
      query: deleteAccountMutation,
    });
    return res.deleteAccount;
  }

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Verify the email address is correct and the server is reachable, then retry.
  2. Check that the account service endpoint is available.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown in checkUserByEmail when the POST to /api/auth/preflight returns a non-OK response, so the existence/registration state of the email cannot be determined.

Common situations: Seen during email sign-in when the preflight check fails due to network or server error. Retry; if persistent, verify the server is reachable.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/7d710181484d00b1. Report an issue: GitHub.