Skip to content

Commit

Permalink
adapt for dj-rest-auth upstream changes in iMerica/dj-rest-auth#227
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Mar 29, 2021
1 parent cb810db commit 2a9cf74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drf_spectacular/contrib/rest_auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf import settings
from rest_framework import serializers

from drf_spectacular.contrib.rest_framework_simplejwt import TokenRefreshSerializerExtension
from drf_spectacular.extensions import OpenApiSerializerExtension, OpenApiViewExtension
from drf_spectacular.utils import extend_schema

Expand Down Expand Up @@ -89,6 +90,13 @@ class Fixed(self.target_class):
return auto_schema._map_serializer(Fixed, direction)


class CookieTokenRefreshSerializerExtension(TokenRefreshSerializerExtension):
target_class = 'dj_rest_auth.jwt_auth.CookieTokenRefreshSerializer'

def get_name(self):
return 'TokenRefresh'


class RestAuthRegisterView(OpenApiViewExtension):
target_class = 'dj_rest_auth.registration.views.RegisterView'

Expand Down

0 comments on commit 2a9cf74

Please sign in to comment.