dj-rest-auth icon indicating copy to clipboard operation
dj-rest-auth copied to clipboard

Throttling Views

Open domlysi opened this issue 2 years ago • 2 comments

So I was about to customize my throttle rates and noticed that dj-rest-auth has already defined throttle_scope = 'dj_rest_auth'.

But why is it not

throttle_scope = 'dj_rest_auth_login' throttle_scope = 'dj_rest_auth_regsiter'

and so on ...

This way, it would be extremely easy to customize the rates. Or am I missing something?

domlysi avatar Apr 21 '23 14:04 domlysi

+1

UTkzhang avatar Nov 08 '23 15:11 UTkzhang

You can override the View class with your own DRF throttle

class UserGoogleLoginAPIView(SocialLoginView):
    """
    Social Google login using Implicit Grant
    """
    throttle_scope = "UserGoogleLoginAPIView"
    adapter_class = GoogleOAuth2Adapter

henningbra avatar May 13 '24 13:05 henningbra