You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting a Token works as expected, but as soon as I try to access this simple view
class TestAPIView(APIView):
permission_classes = (IsAuthenticated,)
def get(self, request):
return Response('test')
I get a TypeError.
Traceback (most recent call last):
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 497, in dispatch
self.initial(request, *args, **kwargs)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 414, in initial
self.perform_authentication(request)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/views.py", line 324, in perform_authentication
request.user
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/request.py", line 227, in user
self._authenticate()
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework/request.py", line 380, in _authenticate
user_auth_tuple = authenticator.authenticate(self)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework_simplejwt/authentication.py", line 40, in authenticate
validated_token = self.get_validated_token(raw_token)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework_simplejwt/authentication.py", line 94, in get_validated_token
return AuthToken(raw_token)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework_simplejwt/tokens.py", line 43, in __init__
self.payload = token_backend.decode(token, verify=verify)
File "/home/user/PycharmProjects/project_x/venv/lib/python3.8/site-packages/rest_framework_simplejwt/backends.py", line 90, in decode
return jwt.decode(
TypeError: decode() got an unexpected keyword argument 'verify'
[07/Oct/2021 12:39:52] "GET /api/test HTTP/1.1" 500 127928
When I uncomment line 94 of file rest_framework_simplejwt/backends.py it will return the view as expected.
I am getting the same now on functions that have previously worked.
On my old virtual environment everything is fine but when I pip install the package fresh this error pops up.
Getting a Token works as expected, but as soon as I try to access this simple view
I get a TypeError.
When I uncomment line 94 of file rest_framework_simplejwt/backends.py it will return the view as expected.
The test request is build manually like this:
Settings look like below.
Any clues on what I am missing?
The text was updated successfully, but these errors were encountered: