Organization Plugin: Empty invitation handling

After implementing organization invitation in my project, I discovered that I can send an empty email in the organization.inviteMember And the function would work correctly.

Example of the bug:
  • User sends an invitation to the organization for an empty string email ""
  • The function takes it normally without throwing an error and stores it in database with email = ""
Expected behavior:
  • User tries sending invitation to an empty email string
  • Error return saying that the email must be valid or something like this
I know that I need to add validation for the email before giving it to the function, but I still think the validation should be implemented in this. I don't know if other functions that accept emails do the same thing as well. Might be something to look into.
Was this page helpful?