feat: Add copy invite link#8355
feat: Add copy invite link#8355zomars merged 34 commits intocalcom:mainfrom ShaneMaglangit:feat/copy_invite_link
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
@ShaneMaglangit is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Forty-seven Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored. |
There was a problem hiding this comment.
Thank you for your contribution 🙏 I have some observations.
- The current code allows any logged in user to createInvite/setInviteExpiration/deactivateInvite/addMemberByLink for ANY team. That's a huge security concern.
- Can we reuse the
inviteMemberprocedure as much as possible? We already ask the team admin if he wants to send the invite via email. We could add the option here to just get the link here. - If we absolutely need to add a new Invite model to the DB then go for it (just rename it to TeamInvite). BUT I would like to reuse
VerificationTokenas much as possible which can be modified to serve the same purpose.
|
@zomars can you give me a bit more context on what is If we're going to reuse it, we would need to add a new metadata for the expiration (or modify it atleast). VerificationToken currently have expiresAt as a non-nullable field. Team invites must have a "never expire" option. We would have to make it nullable or add a new field (expireInDays). Wdyt? |
It is also used for team invites. cal.com/packages/trpc/server/routers/viewer/teams.tsx Lines 339 to 345 in d3f1f8b
I'm ok with updating it to fit both cases. |
|
should we rename "Deactivate" to "Delete"? basically you delete the link, no? we already have "delete" as a string, too |
|
just to confirm: this also works if the person has no account already |
Yup, my fundamental assumption (which I tested prior), is that when accessing a protected route while unauthenticated. You will be redirected to the signup page with a corresponding callback link (invite link). If we somehow lose the invite link with code because of some auth flow process, the user can always revisit the link. That, I think, should sufficiently handle this case, no? |
awesome, yes! |
zomars
left a comment
There was a problem hiding this comment.
Fixed faulty translations that broke e2e tests. But there's now another failure with App Store tests. Blocking to check.

What does this PR do?
Fixes #6581
/claim #6581
Code Creation: https://www.loom.com/share/98d349beeeac4e16bb4dbe4583cff874
Open Invite Link: https://www.loom.com/share/18e33d78ba73436f9ce17ff49df1ad74
Environment: Staging(main branch) / Production
Type of change
How should this be tested?