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 aacdaa5 commit f5e43c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,12 @@ 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 isinstance(payload.get(payload_key), list)
else (payload.get(payload_key) or "").split(" ")
)
if key_value in payload_value:
return payload
raise UnauthorizedInvalidToken()

Check warning on line 236 in auth_jwt/models/auth_jwt_validator.py

View check run for this annotation

Codecov / codecov/patch

auth_jwt/models/auth_jwt_validator.py#L236

Added line #L236 was not covered by tests
except Exception as e:
Expand Down

0 comments on commit f5e43c3

Please sign in to comment.