-
Notifications
You must be signed in to change notification settings - Fork 529
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
New user joining existing orgs #979
Conversation
Your preview environment pr-979-bttf has been deployed. Preview environment endpoints are available at: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX-wise this makes a lot of sense and I think it's a good way to handle it.
I'm curious about how we are handling 'pending' members from a data modeling perspective - we are adding an additional pendingMembers
array to the Organization, however an alternative that screams out to me is the addition of a status
-like field to members, and having it flip between approved
/ pending
(and in the future perhaps archived
) ... Allowing us to keep the single members
array on the Org.
We are duplicating some code, both in the Org model (see one of my comments) and in the putMember
controller method - there is some overlap between addMemberToOrg
and addPendingMemberToOrg
... (Although it seems the latter includes name
and email
... I guess members don't have names but maybe we should add that now.)
Hey @bttf , thanks for the review. I addressed some of the easier DRY / formatting issues, but not 100% sure how we want to proceed with the data model concerns. I think it would be useful to get @jdorn's advice on this as well. On the one hand, I agree that having a single |
…il. we will use a migration script
Update here. Spoke with @jdorn and we'll introduce a new domain field to the org model ( We also decided to keep the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one comment
Features and Changes
Adds a new flow for Cloud users who register using a company email address (verified via SSO). When we detect a potential matching pre-existing organization, we recommend it for the user to join. This should hopefully significantly cut down on the number of duplicate Cloud organizations going forward.
The logic for this flow is as follows:
free-email-domains-typescript
.a. An appropriate organization has a verified domain matching the SSO user's domain. Currently we must rely on the organization's owner email, finding the corresponding user, and making sure they also used a verified method to register (SSO).
b. If no matches, skip recommendation.
c. If match(es), choose the one with the most members.
a. Give the admins tooling to approve or reject pending members.
b. Give the admins a toggle to allow for auto approval (for verified emails).
Testing
Testing is a bit tricky. You'll need to either simulate Cloud on your dev machine (including SSO) or implement a bunch of overrides. To quickly test via these in-code overrides, you can check out the branch and revert this commit
78def93e680ac6ef4b2ee88bdd7b76f511b87c88
.Then, try different combinations of adding
verified: true
orverified: false
to theusers
mongo docs for both the owner and the joining user. Normally, this field is set when using a verified registration method (SSO).Screenshots