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

Don't allow inviting existing admins or invitees #8414

Merged
merged 2 commits into from
May 2, 2024

Conversation

ccschmitz
Copy link
Contributor

Summary

We currently allow people to send invites to existing admins and people who have already been invited to a workspace. This PR adds some validations and error handling to ensure this doesn't happen. The checks for existing emails are case-insensitive.

Screenshot 2024-05-01 at 2 31 06 PM Screenshot 2024-05-01 at 2 31 24 PM

How did you test this change?

  • Try inviting an existing admin and ensure you get an error.
  • Try inviting someone who has already been invited and ensure you get an error.
  • Ensure emails that don't match admins or existing invitees are created correctly.

Are there any deployment considerations?

Adds some DB load when creating a workspace invite, but only a few reads.

Does this work require review from our design team?

N/A

Copy link

linear bot commented May 1, 2024

Copy link

changeset-bot bot commented May 1, 2024

⚠️ No Changeset found

Latest commit: 7d5c6d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "rrdom" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrdom-nodejs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-player" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-snapshot" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/types" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/web-extension" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrvideo" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Copy link
Contributor

@SpennyNDaJets SpennyNDaJets left a comment

Choose a reason for hiding this comment

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

Looks good! I wonder if we can also prevent null emails from being created? It doesn't send an invite, but not sure how this can be taken advantage of
Screenshot 2024-05-02 at 10 43 15 AM

@ccschmitz
Copy link
Contributor Author

@SpennyNDaJets I added required to the input to prevent submitting empty values!

@ccschmitz ccschmitz enabled auto-merge (squash) May 2, 2024 18:12
@ccschmitz ccschmitz merged commit 0f449ad into main May 2, 2024
21 checks passed
@ccschmitz ccschmitz deleted the hig-4580-member-invite-email-is-case-sensitive branch May 2, 2024 18:40
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.

None yet

2 participants