Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Username Validation Incorrect Warning #718

Closed
daniel-n-kaye opened this issue Mar 4, 2023 · 11 comments
Closed

Username Validation Incorrect Warning #718

daniel-n-kaye opened this issue Mar 4, 2023 · 11 comments
Assignees
Labels
enhancement Improving existing functionality good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@daniel-n-kaye
Copy link

This issue tracker is ONLY used for reporting bugs!

Expected Behavior

When editing your profile user name, you get an error when there are spaces in the user name. The warning message should probably say 'username cannot contain spaces' or something.

Current Behavior

image
The actual error message says 'Must start and end with a letter or number' which I think is incorrect

Possible Solution

Show correct user name validation warning, maybe something like "User name cannot contain spaces" or "User name must contain only letters and numbers"

@daniel-n-kaye daniel-n-kaye changed the title Username Validation In Username Validation Incorrect Warning Mar 4, 2023
@vnugent vnugent added enhancement Improving existing functionality help wanted Extra attention is needed good first issue Good for newcomers labels Mar 5, 2023
@vnugent vnugent added this to the v0.8 milestone Mar 5, 2023
@vnugent
Copy link
Contributor

vnugent commented Mar 5, 2023

@daniel-n-kaye thank you for suggesting this!

@all-contributors add @daniel-n-kaye for idea

@allcontributors
Copy link
Contributor

@vnugent

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

I've put up a pull request to add @daniel-n-kaye! 🎉

@daniel-n-kaye
Copy link
Author

daniel-n-kaye commented Mar 6, 2023

@vnugent I'd be willing to try to take this on as a first issue, if that's ok, as it seems like it would hopefully be a pretty isolated update.

@vnugent
Copy link
Contributor

vnugent commented Mar 6, 2023

The error messages are listed here

.test('special-rules', 'Must start and end with a letter or a number.', checkUsername),

Since profile update code requires authentication with Auth0, please send an email: viet at openbeta dot io and I'll reply with some additional API keys for the dev environment.

@shoaib-31
Copy link

@vnugent I think my pull request will do the work.

@hawkishpolicy
Copy link
Contributor

Is this still active?

@clintonlunn
Copy link
Collaborator

This is still an active issue. @danekshea any updates on your changes?

@vnugent
Copy link
Contributor

vnugent commented May 17, 2023

I'm working on moving some of user profile functionality to our own DB. Username update is the first piece so I can take on this issue. What do you all think the error message should be?

Username validation rules:

  1. cannot contain spaces or special characters
  2. must begin with a letter

See #830

@hawkishpolicy
Copy link
Contributor

Based on my understanding of the regex, it appears that it requires a username to begin and end with a letter or number.

It cannot contain spaces but it can contain "." or "-" or "_"

Would these be considered special characters?

I was brainstorming on how best to write this error message so that users can understand it clearly.

What about:

  1. Must begin and end with a letter or number.
  2. Can contain "." or "-" or "_"
  3. Cannot contain spaces.

It's verbose but it is specific.

@zichongkao had some ideas.

That might be a long error message....we could break the regex into components so that it would trip each test as the User tried their new nickname.

@vnugent
Copy link
Contributor

vnugent commented May 17, 2023

Would these be considered special characters?

dot and underscore are allowed (but not as the first character)

@vnugent vnugent self-assigned this May 17, 2023
@hawkishpolicy
Copy link
Contributor

I'm okay with it.

@vnugent vnugent mentioned this issue May 21, 2023
5 tasks
@vnugent vnugent closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants