Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

added changelog, invites limit to free plan

Steven Tey976b43954efc
diff --git a/next.config.js b/next.config.js
index 62c3944911..6ff5ed56f1 100644
--- a/next.config.js
+++ b/next.config.js
@@ -13,6 +13,7 @@ const nextConfig = {
"pbs.twimg.com",
"d2vwwcvoksz7ty.cloudfront.net",
"lh3.googleusercontent.com",
+ "media.cleanshot.cloud", // only for staging purposes
],
},
async headers() {
diff --git a/pages/api/projects/[slug]/invites/index.tsx b/pages/api/projects/[slug]/invites/index.tsx
index f0f01a1510..5ac892b6b7 100644
--- a/pages/api/projects/[slug]/invites/index.tsx
+++ b/pages/api/projects/[slug]/invites/index.tsx
@@ -45,6 +45,24 @@ export default withProjectAuth(async (req, res, project) => {
return res.status(400).end("User already exists in this project.");
}
+ if (project.plan === "free") {
+ const users = await prisma.projectUsers.count({
+ where: {
+ projectId: project.id,
+ },
+ });
+ const invites = await prisma.projectInvite.count({
+ where: {
+ projectId: project.id,
+ },
+ });
+ if (users + invites >= 3) {
+ return res
+ .status(400)
+ .end("You've reached the maximum number of users for the free plan.");
+ }
+ }
+
// same method of generating a token as next-auth
const token = randomBytes(32).toString("hex");
const TWO_WEEKS_IN_SECONDS = 60 * 60 * 24 * 14;
diff --git a/posts/changelog/team-invites.mdx b/posts/changelog/team-invites.mdx
new file mode 100644
index 0000000000..fef394c600
--- /dev/null
+++ b/posts/changelog/team-invites.mdx
@@ -0,0 +1,13 @@
+---
+title: Team Invites
+publishedAt: 2023-05-29
+summary: "You can now invite teammates to your Dub project."
+image: "https://d2vwwcvoksz7ty.cloudfront.net/changelog/team-invites.png"
+author: "steventey"
+---
+
+You can now invite teammates to your Dub project. This is useful if you want to collaborate with your team on a project.
+
+Dub has the most generous free plan in the industry. You can invite up to 3 teammates to your project for free.
+
+Need to invite more teammates? Upgrade to our [Pro plan](/#pricing) for unlimited teammates.