Remove JWT related code
This commit is contained in:
parent
f1f9f935cf
commit
88de997603
13 changed files with 2 additions and 331 deletions
|
|
@ -1,18 +0,0 @@
|
|||
from rest_framework_jwt import views as jwt_views
|
||||
|
||||
from . import serializers
|
||||
|
||||
|
||||
class ObtainJSONWebToken(jwt_views.ObtainJSONWebToken):
|
||||
throttling_scopes = {"*": {"anonymous": "jwt-login", "authenticated": "jwt-login"}}
|
||||
serializer_class = serializers.JSONWebTokenSerializer
|
||||
|
||||
|
||||
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()
|
||||
|
|
@ -10,10 +10,8 @@ from allauth.account import models as allauth_models
|
|||
from rest_auth.serializers import PasswordResetSerializer as PRS
|
||||
from rest_auth.registration.serializers import RegisterSerializer as RS, get_adapter
|
||||
from rest_framework import serializers
|
||||
from rest_framework_jwt import serializers as jwt_serializers
|
||||
|
||||
from funkwhale_api.activity import serializers as activity_serializers
|
||||
from funkwhale_api.common import authentication
|
||||
from funkwhale_api.common import models as common_models
|
||||
from funkwhale_api.common import preferences
|
||||
from funkwhale_api.common import serializers as common_serializers
|
||||
|
|
@ -42,15 +40,6 @@ username_validators = [ASCIIUsernameValidator()]
|
|||
NOOP = object()
|
||||
|
||||
|
||||
class JSONWebTokenSerializer(jwt_serializers.JSONWebTokenSerializer):
|
||||
def validate(self, data):
|
||||
try:
|
||||
return super().validate(data)
|
||||
except authentication.UnverifiedEmail as e:
|
||||
authentication.send_email_confirmation(self.context["request"], e.user)
|
||||
raise serializers.ValidationError("Please verify your email address.")
|
||||
|
||||
|
||||
class RegisterSerializer(RS):
|
||||
invitation = serializers.CharField(
|
||||
required=False, allow_null=True, allow_blank=True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue