iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.66k stars 310 forks source link

Throttling Views #502

Open domlysi opened 1 year ago

domlysi commented 1 year ago

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?

UTkzhang commented 11 months ago

+1

henningbra commented 4 months ago

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