> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Users 集合

`User` 代表 Overleaf 系統中的單一使用者帳號。它儲存驗證資料、功能旗標、編輯器偏好設定、存取權限以及活動中繼資料。

#### 核心身分與驗證

* `_id`：使用者的唯一 MongoDB ObjectId。
* `email` / `emails`：主要電子郵件與歷史電子郵件記錄。
* `hashedPassword`：用於本機驗證、以 BCrypt 雜湊處理的密碼。
* `first_name` / `last_name`：使用者個人資料的姓名欄位。
* `role` / `isAdmin` / `adminRoles`：角色與管理權限旗標。
* `twoFactorAuthentication`：雙重驗證設定（若已啟用）。
* `samlIdentifiers` / `thirdPartyIdentifiers`：外部身分提供者的綁定。

#### 帳號狀態與生命週期

* `signUpDate`：帳號建立的時間戳記。
* `holdingAccount`：帳號是否正在等待確認或受到限制。
* `must_reconfirm`：表示使用者是否必須重新確認其電子郵件。
* `lastPrimaryEmailCheck`：上次驗證主要電子郵件的時間。

#### 登入與活動追蹤

* `lastLoginIp`：上次成功登入的 IP 位址。
* `loginCount`：成功登入的總次數。
* `loginEpoch`：登入工作階段的內部計數器。
* `lastLoggedIn`：上次登入的時間戳記。
* `lastActive`：上次記錄到活動的時間戳記。
* `lastFailedLogin`：上次登入失敗的時間戳記。

#### 編輯器偏好設定（`ace`）

定義使用者對線上編輯器的偏好設定：

* `theme` / `overallTheme`：編輯器與 UI 主題。
* `fontSize`：編輯器字型大小。
* `autoComplete`、`autoPairDelimiters`：編輯輔助功能。
* `spellCheckLanguage`：拼字檢查使用的語言。
* `pdfViewer`：選取的 PDF 檢視器後端。
* `syntaxValidation`、`mathPreview`、`breadcrumbs`：編輯器使用體驗功能。
* `enableNewEditor`：是否啟用新版編輯器 UI。

#### 功能旗標與限制（`features`）

控制使用者可使用的功能：

* `collaborators`：協作者人數上限（`-1` = 無限制）。
* `versioning`、`trackChanges`：歷史記錄與變更追蹤功能。
* `dropbox`、`github`、`gitBridge`：外部整合的可用性。
* `compileTimeout`：最長編譯時間（秒）。
* `compileGroup`：指派的編譯資源群組。
* `aiErrorAssistant`：以 AI 為基礎的編譯錯誤助理旗標。

#### 存取控制與員工權限（`staffAccess`）

定義細緻的員工或出版商存取權限：

* 針對出版商、機構、群組、管理員與實驗的指標與管理權限。

#### 註冊與整合

* `enrollment.sso`：已連結的 SSO 註冊。
* `refProviders`：參考文獻提供者整合。
* `writefull`：Writefull 寫作助理的帳號狀態。
* `dsMobileApp`：行動應用程式設定（若存在）。

#### 計畫與實驗

* `alphaProgram` / `betaProgram` / `labsProgram`：參與搶先體驗計畫的情況。
* `labsExperiments`：已啟用的實驗性功能。
* `awareOfV2`：使用者是否已知悉 V2 編輯器。

#### 推薦與教學

* `referal_id`、`refered_users`、`refered_user_count`：推薦追蹤。
* `completedTutorials`：新手引導與功能教學的進度。

***

以下是一個 Overleaf User 的真實範例。

<Accordion title="User 範例">
  ```json5 theme={null}
  {
      _id: ObjectId('69661f10432ad80d8a7de39d'),
      enrollment: {
          sso: []
      },
      staffAccess: {
          publisherMetrics: false,
          publisherManagement: false,
          institutionMetrics: false,
          institutionManagement: false,
          groupMetrics: false,
          groupManagement: false,
          adminMetrics: false,
          splitTestMetrics: false,
          splitTestManagement: false
      },
      ace: {
          mode: 'none',
          theme: 'textmate',
          overallTheme: 'light-',
          fontSize: 12,
          autoComplete: true,
          autoPairDelimiters: true,
          spellCheckLanguage: 'en',
          pdfViewer: 'pdfjs',
          mathPreview: true,
          breadcrumbs: true,
          referencesSearchMode: 'advanced',
          syntaxValidation: true,
          enableNewEditor: false
      },
      features: {
          collaborators: -1,
          versioning: true,
          dropbox: true,
          github: true,
          gitBridge: true,
          compileTimeout: 180,
          compileGroup: 'standard',
          references: true,
          trackChanges: true,
          aiErrorAssistant: false
      },
      refProviders: {},
      writefull: {
          enabled: null,
          autoCreatedAccount: false,
          isPremium: false,
          premiumSource: null
      },
      aiErrorAssistant: {
          enabled: true
      },
      overleaf: {},
      twoFactorAuthentication: {},
      dsMobileApp: {},
      email: 'admin@overleaf.com',
      first_name: 'admin',
      role: '',
      institution: '',
      isAdmin: true,
      adminRoles: [],
      lastLoginIp: '172.19.0.2',
      loginCount: 14,
      holdingAccount: false,
      must_reconfirm: false,
      refered_users: [],
      refered_user_count: 0,
      alphaProgram: false,
      betaProgram: false,
      labsProgram: false,
      labsExperiments: [],
      awareOfV2: false,
      samlIdentifiers: [],
      thirdPartyIdentifiers: [],
      emails: [
          {
              email: 'admin@overleaf.com',
              createdAt: ISODate('2026-01-15T07:53:24.276Z'),
              reversedHostname: 'moc.faelrevo'
          }
      ],
      signUpDate: ISODate('2026-01-13T10:31:44.786Z'),
      featuresOverrides: [],
      referal_id: 'ncbyrxrr6rrfQzgp',
      __v: 0,
      hashedPassword: '$2a$12$bkfRN7zw27mwaFpUbnSsC.naeFoMAwoRxU0qk7dlPH2obhj8jx.lK',
      loginEpoch: 18,
      lastLoggedIn: ISODate('2026-01-19T05:09:01.075Z'),
      lastActive: ISODate('2026-01-19T05:06:43.145Z'),
      last_name: 'user',
      lastPrimaryEmailCheck: ISODate('2026-01-15T07:53:24.283Z'),
      featuresUpdatedAt: ISODate('2026-01-15T07:53:24.305Z'),
      completedTutorials: {
          'ide-redesign-beta-intro': {
              state: 'completed',
              updatedAt: ISODate('2026-01-18T10:55:18.095Z')
          }
      },
      lastFailedLogin: ISODate('2026-01-19T05:08:53.241Z')
  }
  ```
</Accordion>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.