Skip to content

Commit

Permalink
refactor duplicate code (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
2ykwang committed Jan 13, 2022
1 parent b29565b commit afdea62
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rest_framework_simplejwt/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@ def __init__(

self.algorithm = algorithm
self.signing_key = signing_key
self.verifying_key = verifying_key
self.audience = audience
self.issuer = issuer

self.jwks_client = PyJWKClient(jwk_url) if jwk_url else None
self.leeway = leeway

if algorithm.startswith("HS"):
self.verifying_key = signing_key
else:
self.verifying_key = verifying_key

def _validate_algorithm(self, algorithm):
"""
Ensure that the nominated algorithm is recognized, and that cryptography is installed for those
Expand Down

0 comments on commit afdea62

Please sign in to comment.