toeverything/AFFiNE · error · GraphqlBadRequest

caldav_oauth_unsupported

caldav_oauth_unsupported

Error message

CalDAV does not support OAuth authorization.

What it means

CalDAVProvider.getAuthUrl always throws caldav_oauth_unsupported because CalDAV uses basic credentials rather than OAuth; calling the OAuth entry point for this provider is an API misuse the type system does not prevent.

Source

Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:808

};

@Injectable()
export class CalDAVProvider extends CalendarProvider {
  override provider = CalendarProviderName.CalDAV;

  override get configured() {
    return !!this.config?.enabled && !!this.config?.providers?.length;
  }

  override get supportsOAuth() {
    return false;
  }

  override watchCalendar = undefined;
  override stopChannel = undefined;

  override getAuthUrl(): string {
    throw new GraphqlBadRequest({
      code: 'caldav_oauth_unsupported',
      message: 'CalDAV does not support OAuth authorization.',
    });
  }

  // oxlint-disable-next-line sonarjs/no-identical-functions
  override async exchangeCode(): Promise<any> {
    throw new GraphqlBadRequest({
      code: 'caldav_oauth_unsupported',
      message: 'CalDAV does not support OAuth authorization.',
    });
  }

  // oxlint-disable-next-line sonarjs/no-identical-functions
  override async refreshTokens(): Promise<any> {
    throw new GraphqlBadRequest({
      code: 'caldav_oauth_unsupported',
      message: 'CalDAV does not support OAuth authorization.',

View on GitHub (pinned to b4c8548c09)

Solutions

  1. CalDAV uses basic authentication (username and app password); do not select OAuth for a CalDAV provider.
  2. Reconnect the calendar using the CalDAV basic-auth flow instead of the OAuth button.
  3. If you need OAuth, choose a provider that supports it (e.g. Google) instead of generic CalDAV.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:808 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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