这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@shatfield4
Copy link
Collaborator

@shatfield4 shatfield4 commented Aug 3, 2024

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

@shatfield4 shatfield4 linked an issue Aug 3, 2024 that may be closed by this pull request
@timothycarambat timothycarambat added the PR:needs review Needs review by core team label Aug 5, 2024
Copy link
Member

@timothycarambat timothycarambat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leverage HTML form sanitization where possible, validate this does not block existing usernames from forcing to be changed.

Do these rules also apply to API endpoints for users?

@timothycarambat timothycarambat removed the PR:needs review Needs review by core team label Aug 6, 2024
@shatfield4
Copy link
Collaborator Author

Updated backend validations to only validate the username with all lowercase and no spaces when calling the User.create() db model function.

@timothycarambat timothycarambat merged commit c970665 into master Aug 7, 2024
@timothycarambat timothycarambat deleted the 1315-feat-new-user-account-lowercase-and-spacing branch August 7, 2024 18:35
cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
* force lowercase and no space for new and
 edit user modals

* edit account modal validations

* use pattern for form validation + remove validations from edit user

* revert comment deletions

* comment fix

* update validation message

* update regex
allow updating by block name changes to invalid names

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: New User account - lowercase and spacing

3 participants