File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11"""Django Ninja JWT - JSON Web Token for Django-Ninja"""
22
3- __version__ = "5.1.8 "
3+ __version__ = "5.1.9 "
Original file line number Diff line number Diff line change 1919user_name_field = get_user_model ().USERNAME_FIELD # type: ignore
2020
2121
22+ class AuthUserSchema (ModelSchema ):
23+ class Config :
24+ model = get_user_model ()
25+ include = [user_name_field ]
26+
27+
2228class TokenObtainSerializer (ModelSchema ):
2329 class Config :
2430 model = get_user_model ()
@@ -69,10 +75,9 @@ def get_token(cls, user: Type[AbstractUser]) -> Type[Token]:
6975 )
7076
7177
72- class TokenObtainPairOutput (Schema ):
78+ class TokenObtainPairOutput (AuthUserSchema ):
7379 refresh : str
7480 access : str
75- username : str
7681
7782
7883class TokenObtainPairSerializer (TokenObtainSerializer ):
@@ -97,9 +102,8 @@ def output_schema(self):
97102 return TokenObtainPairOutput (** self .dict (exclude = {"password" }))
98103
99104
100- class TokenObtainSlidingOutput (Schema ):
105+ class TokenObtainSlidingOutput (AuthUserSchema ):
101106 token : str
102- username : str
103107
104108
105109class TokenObtainSlidingSerializer (TokenObtainSerializer ):
You can’t perform that action at this time.
0 commit comments