Skip to content

Commit

Permalink
None algorithm now converts empty string to None prior to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-adams committed Mar 17, 2015
1 parent 3e59fe6 commit 75ab144
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jwt/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class NoneAlgorithm(Algorithm):
operations are required.
"""
def prepare_key(self, key):
if key == '':
key = None

if key is not None:
raise InvalidKeyError('When alg = "none", key value must be None.')

Expand Down

0 comments on commit 75ab144

Please sign in to comment.