Skip to content

Commit

Permalink
Differentiate between two errors (#809)
Browse files Browse the repository at this point in the history
* Differentiate between two errors

* #809 mention in the changelog
  • Loading branch information
irdkwmnsb authored Jan 3, 2023
1 parent 45fff3a commit 4e15dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project adheres to `Semantic Versioning <https://semver.org/>`__.
Changed
~~~~~~~

- Changed the error message when the token audience doesn't match the expected audience by @irdkwmnsb `#809 <https://github.com/jpadilla/pyjwt/pull/809>`__

Fixed
~~~~~

Expand Down
2 changes: 1 addition & 1 deletion jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _validate_aud(
audience = [audience]

if all(aud not in audience_claims for aud in audience):
raise InvalidAudienceError("Invalid audience")
raise InvalidAudienceError("Audience doesn't match")

def _validate_iss(self, payload: dict[str, Any], issuer: Any) -> None:
if issuer is None:
Expand Down

0 comments on commit 4e15dbd

Please sign in to comment.