[PR #2037] [MERGED] New user account validations #3863

Closed
opened 2026-02-22 18:34:39 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2037
Author: @shatfield4
Created: 8/2/2024
Status: Merged
Merged: 8/7/2024
Merged by: @timothycarambat

Base: masterHead: 1315-feat-new-user-account-lowercase-and-spacing


📝 Commits (9)

  • 3c0c577 force lowercase and no space for new and
  • 4d76c9c edit account modal validations
  • ca63a01 use pattern for form validation + remove validations from edit user
  • 4aa1c47 revert comment deletions
  • 92ee2e5 comment fix
  • e844050 Merge branch 'master' into 1315-feat-new-user-account-lowercase-and-spacing
  • 2a986e0 update validation message
  • dc8efbb update regex
  • aaf63a7 Merge branch 'master' into 1315-feat-new-user-account-lowercase-and-spacing

📊 Changes

4 files changed (+56 additions, -9 deletions)

View changed files

📝 frontend/src/components/UserMenu/AccountModal/index.jsx (+10 -1)
📝 frontend/src/pages/Admin/Users/NewUserModal/index.jsx (+18 -2)
📝 frontend/src/pages/Admin/Users/UserRow/EditUserModal/index.jsx (+10 -2)
📝 server/models/user.js (+18 -4)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #1315

What is in this change?

  • On new user creation we now validate for usernames that are lowercase and have no spaces
  • Modified NewUserModal, EditUserModal, and AccountModal components for these validations
  • Frontend validation and User prisma model are updated for these validations
  • We do not validate the update function in the User model to prevent forcing users to have to change usernames when updating just their password
  • Still allow login with usernames that are not all lowercase and have spaces to prevent current users from getting locked out of their accounts

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/2037 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 8/2/2024 **Status:** ✅ Merged **Merged:** 8/7/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `1315-feat-new-user-account-lowercase-and-spacing` --- ### 📝 Commits (9) - [`3c0c577`](https://github.com/Mintplex-Labs/anything-llm/commit/3c0c5774bcd696e8f9300f93cb059d06c9080965) force lowercase and no space for new and - [`4d76c9c`](https://github.com/Mintplex-Labs/anything-llm/commit/4d76c9cc97a2109e8aa980aec77e95f1a047eedc) edit account modal validations - [`ca63a01`](https://github.com/Mintplex-Labs/anything-llm/commit/ca63a01b95658ce08051d353e05ba316eb385f06) use pattern for form validation + remove validations from edit user - [`4aa1c47`](https://github.com/Mintplex-Labs/anything-llm/commit/4aa1c47622868dbd1d9c71f31b429cf3c8769102) revert comment deletions - [`92ee2e5`](https://github.com/Mintplex-Labs/anything-llm/commit/92ee2e549afa7a8711eab4188032f896d47c7c11) comment fix - [`e844050`](https://github.com/Mintplex-Labs/anything-llm/commit/e84405044420db077165e549aecba9d91ea79f70) Merge branch 'master' into 1315-feat-new-user-account-lowercase-and-spacing - [`2a986e0`](https://github.com/Mintplex-Labs/anything-llm/commit/2a986e0367334afd699239c78d3379a7c994ebe1) update validation message - [`dc8efbb`](https://github.com/Mintplex-Labs/anything-llm/commit/dc8efbb0b3115c228e06267eecd81cddf370a3e8) update regex - [`aaf63a7`](https://github.com/Mintplex-Labs/anything-llm/commit/aaf63a76dabb2f0ffe6f65a7840f89f05a19e823) Merge branch 'master' into 1315-feat-new-user-account-lowercase-and-spacing ### 📊 Changes **4 files changed** (+56 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/UserMenu/AccountModal/index.jsx` (+10 -1) 📝 `frontend/src/pages/Admin/Users/NewUserModal/index.jsx` (+18 -2) 📝 `frontend/src/pages/Admin/Users/UserRow/EditUserModal/index.jsx` (+10 -2) 📝 `server/models/user.js` (+18 -4) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #1315 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - On new user creation we now validate for usernames that are lowercase and have no spaces - Modified `NewUserModal`, `EditUserModal`, and `AccountModal` components for these validations - Frontend validation and `User` prisma model are updated for these validations - We do not validate the update function in the `User` model to prevent forcing users to have to change usernames when updating just their password - Still allow login with usernames that are not all lowercase and have spaces to prevent current users from getting locked out of their accounts ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:34:39 -05:00
yindo closed this issue 2026-02-22 18:34:39 -05:00
yindo changed title from [PR #2037] New user account validations to [PR #2037] [MERGED] New user account validations 2026-06-05 15:15:37 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3863