giteaSyncUserCredentials holds one document per user who linked a Gitea account for Gitea Sync. It stores the user’s OAuth tokens, encrypted. It belongs to the gitea-sync web module (services/web/modules/gitea-sync). The schema is in services/web/modules/gitea-sync/app/models/giteaSyncUserCredentials.mjs, and all access goes through services/web/modules/gitea-sync/app/src/TokenManager.mjs.
Fields
Who Writes It
Who Reads It
Indexes
Mongoose
autoIndex is off (services/web/app/src/infrastructure/Mongoose.mjs:7), so the schema’s unique: true on userId creates nothing. No migration creates indexes for this collection.
Notes
- Changing
GITEA_TOKEN_CIPHER_PASSWORDmakes the stored credentials unreadable. Those users then count as not linked until they link again. - A deleted user keeps the document until the user expires.

