Skip to content

Commit 43d5b2f

Browse files
Remove verify from jwt.decode() to follow PyJWT v2.2.0. (jazzband#472)
* Fix test not to overwrite PyJWT.decode with PyJWS.decode. Co-authored-by: Andrew Chen Wang <[email protected]>
1 parent 7759aa8 commit 43d5b2f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

rest_framework_simplejwt/backends.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def decode(self, token, verify=True):
9191
token,
9292
self.get_verifying_key(token),
9393
algorithms=[self.algorithm],
94-
verify=verify,
9594
audience=self.audience,
9695
issuer=self.issuer,
9796
leeway=self.leeway,

tests/test_backends.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ def test_decode_when_algorithm_not_available(self):
276276

277277
pyjwt_without_rsa = PyJWS()
278278
pyjwt_without_rsa.unregister_algorithm('RS256')
279-
with patch.object(jwt, 'decode', new=pyjwt_without_rsa.decode):
279+
def _decode(jwt, key, algorithms, options, audience, issuer, leeway):
280+
return pyjwt_without_rsa.decode(jwt, key, algorithms, options)
281+
with patch.object(jwt, 'decode', new=_decode):
280282
with self.assertRaisesRegex(TokenBackendError, 'Invalid algorithm specified'):
281283
self.rsa_token_backend.decode(token)
282284

0 commit comments

Comments
 (0)