Skip to content

Commit

Permalink
imp: handle payload_value of list
Browse files Browse the repository at this point in the history
  • Loading branch information
dnplkndll committed Jan 18, 2025
1 parent b6cec16 commit fabb83e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth_jwt/models/auth_jwt_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ def _decode(self, token, secret=None):
)
if len((self.audience or "").split(",") or []) > 0:
for key_value in (self.audience or "").split(","):
if key_value in (payload.get(payload_key) or "").split(" "):
payload_value = payload.get(payload_key)
if not payload.get(payload_key).isinstance(list):
payload_value = (payload.get(payload_key) or "").split(" ")
if key_value in payload_value:
return payload
raise UnauthorizedInvalidToken()
except Exception as e:
Expand Down

0 comments on commit fabb83e

Please sign in to comment.