LibreChat/packages/data-schemas/src/schema
Danny Avila 71a3b48504
🔑 fix: Require OTP Verification for 2FA Re-Enrollment and Backup Code Regeneration (#12223)
* fix: require OTP verification for 2FA re-enrollment and backup code regeneration

* fix: require OTP verification for account deletion when 2FA is enabled

* refactor: Improve code formatting and readability in TwoFactorController and UserController

- Reformatted code in TwoFactorController and UserController for better readability by aligning parameters and breaking long lines.
- Updated test cases in deleteUser.spec.js and TwoFactorController.spec.js to enhance clarity by formatting object parameters consistently.

* refactor: Consolidate OTP and backup code verification logic in TwoFactorController and UserController

- Introduced a new `verifyOTPOrBackupCode` function to streamline the verification process for TOTP tokens and backup codes across multiple controllers.
- Updated the `enable2FA`, `disable2FA`, and `deleteUserController` methods to utilize the new verification function, enhancing code reusability and readability.
- Adjusted related tests to reflect the changes in verification logic, ensuring consistent behavior across different scenarios.
- Improved error handling and response messages for verification failures, providing clearer feedback to users.

* chore: linting

* refactor: Update BackupCodesItem component to enhance OTP verification logic

- Consolidated OTP input handling by moving the 2FA verification UI logic to a more consistent location within the component.
- Improved the state management for OTP readiness, ensuring the regenerate button is only enabled when the OTP is ready.
- Cleaned up imports by removing redundant type imports, enhancing code clarity and maintainability.

* chore: lint

* fix: stage 2FA re-enrollment in pending fields to prevent disarmament window

enable2FA now writes to pendingTotpSecret/pendingBackupCodes instead of
overwriting the live fields. confirm2FA performs the atomic swap only after
the new TOTP code is verified. If the user abandons mid-flow, their
existing 2FA remains active and intact.
2026-03-14 01:51:31 -04:00
..
accessRole.ts 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
aclEntry.ts 🛂 feat: Role as Permission Principal Type 2025-08-13 16:24:23 -04:00
action.ts 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
agent.ts ⏲️ feat: Defer Loading MCP Tools (#11270) 2026-01-28 17:44:30 -05:00
agentApiKey.ts 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
agentCategory.ts 🌟 fix: Add Composite Indexes to Agent Categories for CosmosDB Compatibility (#9430) 2025-09-03 02:16:18 -04:00
assistant.ts 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
balance.ts 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
banner.ts 📌 feat: Add Support for Persistable (Non-Dismissible) Banners (#10730) 2025-12-11 16:37:22 -05:00
categories.ts 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
conversationTag.ts 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
convo.ts 🔧 refactor: batching documents on meili index reset (#11165) 2026-01-02 10:50:06 -05:00
defaults.ts 🎚️ feat: Add Thinking Level Parameter for Gemini 3+ Models (#11994) 2026-02-28 16:56:10 -05:00
file.ts 🆔 fix: Atomic File Dedupe, Bedrock Tokens Fix, and Allowed MIME Types (#11675) 2026-02-07 13:26:18 -05:00
group.ts feat: Add cursor pagination utilities and refine user/group/role types in @librechat/data-schemas (#9218) 2025-08-23 00:18:31 -04:00
index.ts 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
key.ts 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
mcpServer.ts 🏗️ feat: Dynamic MCP Server Infrastructure with Access Control (#10787) 2025-12-11 16:38:37 -05:00
memory.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
message.ts 🔀 refactor: Conditional Mapping Support for Multi-Convo (Parallel) Messages (#11180) 2026-01-02 19:42:54 -05:00
pluginAuth.ts 🗝️ feat: User Provided Credentials for MCP Servers (#7980) 2025-06-19 18:27:55 -04:00
preset.ts 🤖 feat: Claude Opus 4.6 - 1M Context, Premium Pricing, Adaptive Thinking (#11670) 2026-02-06 18:35:36 -05:00
project.ts 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
prompt.ts 🗨️ refactor: Optimize Prompt Queries 2025-08-13 16:24:25 -04:00
promptGroup.ts 🗨️ refactor: Optimize Prompt Queries 2025-08-13 16:24:25 -04:00
role.ts 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
session.ts 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
share.ts 🔗 fix: Add branch-specific shared links (targetMessageId) (#10016) 2025-10-10 08:42:05 -04:00
token.ts 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
toolCall.ts 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
transaction.ts 🪙 feat: Add messageId to Transactions (#11987) 2026-02-27 23:50:13 -05:00
user.ts 🔑 fix: Require OTP Verification for 2FA Re-Enrollment and Backup Code Regeneration (#12223) 2026-03-14 01:51:31 -04:00