Open afanzaimoyu opened 10 months ago
@afanzaimoyu You can create your own token generation as shown here
Have the same problem. The problem is in ModelSchema
, because it have metaclass that check django model fields on python module ninja_jwt.schema
load. So if any code use at least one class from ninja_jwt.schema
then ninja.ModelSchema
will validate fields from ninja_jwt.TokenObtainInputSchemaBase.Config.model_fields
and raise error if password field not defined for user model.
So it will be cool to take ninja_jwt.TokenObtainInputSchemaBase.Config.model_fields
from api_settings
. Because variant with own token generation as shown here will not work (use import from ninja_jwt.schema
).
Thanks, I think I'll do it
Hello, when calling the "http://localhost:8000/api/token/pair" endpoint, I need to provide username and password. However, my User model does not have the password field. How can I modify this without changing the source code?
I only know how to make modifications here, but I prefer not to modify the source code: