From 520938ab5c59b6736327be93dfb099026eff82d5 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:35:00 +0530 Subject: [PATCH] chore: add rate limiting in magic generate endpoint (#5322) --- apiserver/plane/authentication/views/app/magic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apiserver/plane/authentication/views/app/magic.py b/apiserver/plane/authentication/views/app/magic.py index 12f8a0c0b..980eb4e7c 100644 --- a/apiserver/plane/authentication/views/app/magic.py +++ b/apiserver/plane/authentication/views/app/magic.py @@ -29,6 +29,7 @@ from plane.authentication.adapter.error import ( AuthenticationException, AUTHENTICATION_ERROR_CODES, ) +from plane.authentication.rate_limit import AuthenticationThrottle class MagicGenerateEndpoint(APIView): @@ -37,6 +38,10 @@ class MagicGenerateEndpoint(APIView): AllowAny, ] + throttle_classes = [ + AuthenticationThrottle, + ] + def post(self, request): # Check if instance is configured instance = Instance.objects.first()