summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim <me@alzhanov.ru>2023-01-03 16:22:42 +0300
committerGitHub <noreply@github.com>2023-01-03 19:22:42 +0600
commit4e15dbd9aaef56b78ac8f885220d94f785d2b30c (patch)
tree0696b6ef0cb06e9efd45c93e76e51878d34d0c46
parent45fff3ae19ae2930f92929e48d4ad45f41502f31 (diff)
downloadpyjwt-4e15dbd9aaef56b78ac8f885220d94f785d2b30c.tar.gz
Differentiate between two errors (#809)
* Differentiate between two errors * #809 mention in the changelog
-rw-r--r--CHANGELOG.rst2
-rw-r--r--jwt/api_jwt.py2
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: