Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

minor improvements

Blue Mouseedce70e93c3c
diff --git a/src/common/constants.ts b/src/common/constants.ts
index 3613032c0..298547b72 100644
--- a/src/common/constants.ts
+++ b/src/common/constants.ts
@@ -130,6 +130,7 @@ const JWT_LIFE_TIME = 7 * 24 * 60 * 60
const HISTORY_LIFE_TIME_DAYS = 30
// is ProjectID a valid key
+// TODO: ALLOW ONLY WHITELISTED PID CHARACTERS
const isValidPID = (pid: string) => _size(pid) === 12
// redis keys
diff --git a/src/project/project.controller.ts b/src/project/project.controller.ts
index abb0169e2..62c823e5e 100644
--- a/src/project/project.controller.ts
+++ b/src/project/project.controller.ts
@@ -108,13 +108,13 @@ export class ProjectController {
return project
} else {
const user = await this.userService.findOneWithRelations(userId, ['projects'])
- const maxProjects = ACCOUNT_PLANS[user.planCode].maxProjects
+ const maxProjects = ACCOUNT_PLANS[user.planCode]?.maxProjects
if (!user.isActive) {
throw new ForbiddenException('Please, verify your email address first')
}
- if (!isSelfhosted && _size(user.projects) >= (maxProjects || 5)) {
+ if (_size(user.projects) >= (maxProjects || 5)) {
throw new ForbiddenException(`You cannot create more than ${maxProjects} projects on your account plan. Please upgrade to be able to create more projects.`)
}