human-essentials: [Bug] partners inviting new users can enter invalid email addresses. (I entered newuser@example.co,)

Summary

Fix the email check when a partner is inviting user

Why

Prevents bad data and partner frustration. Makes incorrect data slightly less likely

Details

I tried this with newusers@example.co, which should not work, but creates a user.
With “Sam”, it claims to create the user, but it does not appear in the list

Recreation

Sign in as verified@example.com Click on the email in the top right Click on “My co-workers” Click on “Invite new user” Enter newuser@example.co, in the email Click on “Create User”

Criteria for completion

  • only validly formatted user ids are accepted when partners are inviting new users
  • tests to support that functionality

Note We’re using email validation elsewhere (e.g., AccountRequest model). If that isn’t wretched, use it here too!

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

@Learningstuff98 not every e-mail ends in .com - in fact, most of them will be at least .org. The regex should be sufficient - the question is why it isn’t catching these errors - either it’s not being called at all, or there’s something wrong with the regex itself.

Ah whoops I missed the , in your sample. @Learningstuff98 the regex should prevent bad characters like the one scooter provided. We need to figure out if the validation isn’t being triggered for some reason, or if the regex isn’t strong enough to catch bad characters like this.