Skip to content

Commit cbb55d1

Browse files
dnplkndllkobros-tech
authored andcommitted
imp: handle payload_value of list
1 parent a210635 commit cbb55d1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

auth_jwt/models/auth_jwt_validator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ def _decode(self, token, secret=None):
226226
)
227227
if len((self.audience or "").split(",") or []) > 0:
228228
for key_value in (self.audience or "").split(","):
229-
if key_value in (payload.get(payload_key) or "").split(" "):
229+
payload_value = (
230+
payload.get(payload_key)
231+
if isinstance(payload.get(payload_key), list)
232+
else (payload.get(payload_key) or "").split(" ")
233+
)
234+
if key_value in payload_value:
230235
return payload
231236
raise UnauthorizedInvalidToken()
232237
except Exception as e:

0 commit comments

Comments
 (0)