Skip to content

Commit

Permalink
fix: Typing and exception default codes (#101)
Browse files Browse the repository at this point in the history
* fixed wrong method typing #100

* fixed default code #78
  • Loading branch information
eadwinCode authored Nov 11, 2024
1 parent 111e1a8 commit f7b7dfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ninja_jwt/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_validated_token(cls, raw_token) -> Type[Token]:
}
)

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

return user

def jwt_authenticate(self, request: HttpRequest, token: str) -> Type[AbstractUser]:
def jwt_authenticate(self, request: HttpRequest, token: str) -> AbstractUser:
request.user = AnonymousUser()
validated_token = self.get_validated_token(token)
user = self.get_user(validated_token)
Expand Down
4 changes: 2 additions & 2 deletions ninja_jwt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


class DetailDictMixin:
default_detail = ""
default_code = ""
default_detail: str
default_code: str

def __init__(self, detail=None, code=None) -> None:
"""
Expand Down

0 comments on commit f7b7dfc

Please sign in to comment.