getmeli / meli

Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Other
2.4k stars 97 forks source link

Handling of MAX_ORGS is not right #250

Open mtiller opened 2 years ago

mtiller commented 2 years ago

It seems that if you provide any other value besides 1 for MELI_MAX_ORGS, then the limit is not enforced. I scanned the code and couldn't find an obvious source for the bug. My experience is that if you configure a server with the MELI_MAX_ORGS value set to 5, for example, you can create as many orgs as you want, you'll never get an error.

gempain commented 2 years ago

That's strange, the maxOrgsGuard is correctly placed in the createOrg handler.

mtiller commented 2 years ago

It isn't that the guard isn't working. For the default value, it definitely prevents organizations from being created. But when I set it to 10, I was then able to make more than 10 orgs. Then if I set it to 5 (with 10+ orgs already existing) and it still allowed me to create more.

gempain commented 2 years ago

Oh wow okay that is really weird. I'll have a look this weekend because this is an issue. Thanks so much for reporting!