2019-09-17 09:23:59 +00:00
|
|
|
from rest_framework_jwt import views as jwt_views
|
|
|
|
|
2020-04-01 13:24:40 +00:00
|
|
|
from . import serializers
|
|
|
|
|
2019-09-17 09:23:59 +00:00
|
|
|
|
|
|
|
class ObtainJSONWebToken(jwt_views.ObtainJSONWebToken):
|
|
|
|
throttling_scopes = {"*": {"anonymous": "jwt-login", "authenticated": "jwt-login"}}
|
2020-04-01 13:24:40 +00:00
|
|
|
serializer_class = serializers.JSONWebTokenSerializer
|
2019-09-17 09:23:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RefreshJSONWebToken(jwt_views.RefreshJSONWebToken):
|
|
|
|
throttling_scopes = {
|
|
|
|
"*": {"anonymous": "jwt-refresh", "authenticated": "jwt-refresh"}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
obtain_jwt_token = ObtainJSONWebToken.as_view()
|
|
|
|
refresh_jwt_token = RefreshJSONWebToken.as_view()
|