diff options
author | Maxim <me@alzhanov.ru> | 2023-01-03 16:22:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-03 19:22:42 +0600 |
commit | 4e15dbd9aaef56b78ac8f885220d94f785d2b30c (patch) | |
tree | 0696b6ef0cb06e9efd45c93e76e51878d34d0c46 | |
parent | 45fff3ae19ae2930f92929e48d4ad45f41502f31 (diff) | |
download | pyjwt-4e15dbd9aaef56b78ac8f885220d94f785d2b30c.tar.gz |
Differentiate between two errors (#809)
* Differentiate between two errors
* #809 mention in the changelog
-rw-r--r-- | CHANGELOG.rst | 2 | ||||
-rw-r--r-- | jwt/api_jwt.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 37875e9..3c69338 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 ~~~~~ diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index 8840708..fd8a8bf 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -331,7 +331,7 @@ class PyJWT: 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: |