-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AAP-38778] chore: improve jwt expired exception logging
- Loading branch information
1 parent
3fac5f3
commit b44b3a7
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
from rest_framework.exceptions import APIException | ||
|
||
|
||
class InvalidService(Exception): | ||
def __init__(self, service): | ||
super().__init__(f"This authentication class requires {service}.") | ||
|
||
|
||
class InvalidTokenException(APIException): | ||
status_code = 498 | ||
status_text = "Invalid Token" | ||
default_detail = "Invalid or expired token." | ||
default_code = "invalid_token" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters