-
Notifications
You must be signed in to change notification settings - Fork 11.5k
feat: add organization join banner for users with matching email domain #26554
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
Draft
PeerRich
wants to merge
5
commits into
main
Choose a base branch
from
devin/org-join-banner-1767804532
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Show TopBanner for free users whose email domain has a verified OrganizationDomain
- Banner title: 'An organization for {domain} exists. Would you like to join it?'
- CTA button: 'Join team' that shows toast 'Owner notified'
- Send email to all org admins/owners when user clicks 'Join team'
- Add email template for organization join request notification
- Use repository pattern for database access
Co-Authored-By: peer@cal.com <peer@cal.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Show TopBanner for free users whose email domain has a verified OrganizationDomain
- Banner title: 'An organization for {domain} exists. Would you like to join it?'
- CTA button: 'Join team' that shows toast 'Owner notified'
- Send email to all org admins/owners when user clicks 'Join team'
- Add email template for organization join request notification
- Use repository pattern for database access
Co-Authored-By: peer@cal.com <peer@cal.com>
Also fix lint-staged config to exclude locale files from biome format check, since biome is configured to ignore public/ directories but lint-staged was still trying to format them, causing commit failures. Co-Authored-By: peer@cal.com <peer@cal.com>
…r.devin.ai/proxy/github.com/calcom/cal.com into devin/org-join-banner-1767804532
Addresses security concern where an attacker could create an account with an unverified email (e.g., attacker@company.com) and trigger join request emails to org admins without ever verifying ownership of that email. Both handlers now check user.emailVerified before: - Showing the organization join banner - Allowing the user to request membership Co-Authored-By: peer@cal.com <peer@cal.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Shows a TopBanner to free users (individuals not in an organization) whose email domain matches a verified OrganizationDomain. The banner prompts them to join the organization with a "Join team" CTA button.
When the user clicks "Join team":
Key changes:
OrgJoinBannercomponent integrated into the banner systemcheckForVerifiedOrgDomainto detect matching organizationsrequestOrgMembershipto handle the join request and send emailsOrganizationJoinRequestEmailfor admin notificationsOrganizationRepositoryfor data accesslint-staged.config.mjsto exclude locale files from biome format check (biome was configured to ignorepublic/directories but lint-staged was still trying to format them)Updates since last revision
Security fix: Added
emailVerifiedcheck to both handlers to prevent attackers from creating accounts with unverified emails (e.g.,attacker@company.com) and triggering join request emails to org admins without ever verifying ownership of that email address.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
orgAutoAcceptEmailset to a domain (e.g.,acme.com)user@acme.com)Security test: Create a user with an unverified email matching an org domain - verify the banner does NOT appear and the join request mutation returns a FORBIDDEN error.
Human Review Checklist
emailVerifiedcheck prevents unverified email abuse (security-critical)orgAutoAcceptEmail)/public/static/locales/from biome format checkChecklist
Link to Devin run: https://app.devin.ai/sessions/6f9977d40aa74a20890c8318f3434e2f
Requested by: @PeerRich