{"record":{"id":"7e09bd7cbc38dec3","repo":"toeverything/AFFiNE","slug":"caldav-oauth-unsupported","errorCode":"caldav_oauth_unsupported","errorMessage":"CalDAV does not support OAuth authorization.","messagePattern":"CalDAV does not support OAuth authorization\\.","errorType":"exception","errorClass":"GraphqlBadRequest","httpStatus":400,"severity":"error","filePath":"packages/backend/server/src/plugins/calendar/providers/caldav.ts","lineNumber":808,"sourceCode":"};\n\n@Injectable()\nexport class CalDAVProvider extends CalendarProvider {\n  override provider = CalendarProviderName.CalDAV;\n\n  override get configured() {\n    return !!this.config?.enabled && !!this.config?.providers?.length;\n  }\n\n  override get supportsOAuth() {\n    return false;\n  }\n\n  override watchCalendar = undefined;\n  override stopChannel = undefined;\n\n  override getAuthUrl(): string {\n    throw new GraphqlBadRequest({\n      code: 'caldav_oauth_unsupported',\n      message: 'CalDAV does not support OAuth authorization.',\n    });\n  }\n\n  // oxlint-disable-next-line sonarjs/no-identical-functions\n  override async exchangeCode(): Promise<any> {\n    throw new GraphqlBadRequest({\n      code: 'caldav_oauth_unsupported',\n      message: 'CalDAV does not support OAuth authorization.',\n    });\n  }\n\n  // oxlint-disable-next-line sonarjs/no-identical-functions\n  override async refreshTokens(): Promise<any> {\n    throw new GraphqlBadRequest({\n      code: 'caldav_oauth_unsupported',\n      message: 'CalDAV does not support OAuth authorization.',","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/backend/server/src/plugins/calendar/providers/caldav.ts#L790-L826","documentation":"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.","triggerScenarios":"Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:808 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["CalDAV uses basic authentication (username and app password); do not select OAuth for a CalDAV provider.","Reconnect the calendar using the CalDAV basic-auth flow instead of the OAuth button.","If you need OAuth, choose a provider that supports it (e.g. Google) instead of generic CalDAV."],"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-14T00:17:10.932Z"}