Skip to content

Commit f7b7dfc

Browse files
authored
fix: Typing and exception default codes (#101)
* fixed wrong method typing #100 * fixed default code #78
1 parent 111e1a8 commit f7b7dfc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ninja_jwt/authentication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_validated_token(cls, raw_token) -> Type[Token]:
4343
}
4444
)
4545

46-
def get_user(self, validated_token) -> Type[AbstractUser]:
46+
def get_user(self, validated_token) -> AbstractUser:
4747
"""
4848
Attempts to find and return a user using the given validated token.
4949
"""
@@ -64,7 +64,7 @@ def get_user(self, validated_token) -> Type[AbstractUser]:
6464

6565
return user
6666

67-
def jwt_authenticate(self, request: HttpRequest, token: str) -> Type[AbstractUser]:
67+
def jwt_authenticate(self, request: HttpRequest, token: str) -> AbstractUser:
6868
request.user = AnonymousUser()
6969
validated_token = self.get_validated_token(token)
7070
user = self.get_user(validated_token)

ninja_jwt/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
class DetailDictMixin:
6-
default_detail = ""
7-
default_code = ""
6+
default_detail: str
7+
default_code: str
88

99
def __init__(self, detail=None, code=None) -> None:
1010
"""

0 commit comments

Comments
 (0)