gitroomhq/postiz-app · warning · HttpException

not_found

not_found

Error message

{
  error: 'not_found',
  error_description: 'OIDC email claims are not enabled',
}

What it means

Returned as HTTP 404 from getUserInfo when the server-level OIDC email claims feature flag (enableOidcEmailClaims(), typically an env/config toggle) is disabled. The /userinfo-style endpoint is gated off entirely rather than returning claims.

Source

Thrown at libraries/nestjs-libraries/src/database/prisma/oauth/oauth.service.ts:344

    );

    return {
      id: organizationId,
      cus: paymentId,
      access_token: token,
      token_type: 'bearer',
      scope: oauthScope(clientId),
    };
  }

  async getOrgByOAuthToken(token: string) {
    const encrypted = AuthService.fixedEncryption(token);
    return this._oauthRepository.findByAccessToken(encrypted);
  }

  async getUserInfo(authorization?: string) {
    if (!enableOidcEmailClaims()) {
      throw new HttpException(
        {
          error: 'not_found',
          error_description: 'OIDC email claims are not enabled',
        },
        HttpStatus.NOT_FOUND
      );
    }

    const token = extractBearerToken(authorization);
    if (!token) {
      throw new HttpException(
        { error: 'invalid_token', error_description: 'Bearer token required' },
        HttpStatus.UNAUTHORIZED
      );
    }

    const authorizationRecord = await this.getOrgByOAuthToken(token);
    if (!authorizationRecord) {

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Enable the OIDC email claims feature via the deployment's environment configuration (set the relevant env vars and restart)
  2. If self-hosting, check .env / compose for the OIDC toggle and the OpenAI OAuth client id config
  3. If you don't need email claims, stop calling getUserInfo

Example fix

# before
# .env has no OIDC config
# after
ENABLE_OIDC_EMAIL_CLAIMS=true
OPENAI_OAUTH_CLIENT_ID=<your-client-id>
Defensive patterns

Strategy: type-guard

Validate before calling

if (!serverSupportsOidcEmailClaims) { throw new Error('userinfo is disabled on this deployment'); }

Type guard

const canUseUserinfo = (config: {oidcEmailClaimsEnabled: boolean}): boolean => config.oidcEmailClaimsEnabled;

Try / catch

try { return await getUserInfo(auth); } catch (e) { if (e?.response?.data?.error === 'not_found') return null; throw e; }

Prevention

When it happens

Trigger: Calling the user info endpoint on a Postiz deployment where the OIDC email claims env variable is not set/enabled (e.g. missing ENABLE_OIDC_EMAIL_CLAIMS or OPENAI_OAUTH_CLIENT_ID setup).

Common situations: Self-hosted deployments without the OIDC env config; upgrading Postiz and expecting userinfo to work without enabling the feature; hitting the wrong deployment where the flag isn't set.

Understand the failure class

Background: NOT_FOUND error code: why tRPC, Harbor, Nacos and other libraries return 404 "not found" errors for resources that may still exist — this error's family across 11 libraries.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/6fdaefff136af939. Report an issue: GitHub.