refactor: use AbstractBaseUser instead of AbstractUser for compatibility #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates type hints from AbstractUser to AbstractBaseUser in the JWTBaseAuthentication and related classes.
Reason
Using AbstractUser assumes that the user model inherits from Django's default user model, which may not always be the case. Projects that implement a custom user model often inherit directly from AbstractBaseUser to define their own fields and behaviors.
By updating the type hints to AbstractBaseUser, we improve compatibility with custom user models and avoid potential type-checking or runtime issues in such cases.
This change does not affect runtime behavior but provides better flexibility and correctness in projects that override Django’s default User model.
Impact
Broader support for projects using custom user models
More accurate type annotations for developer tooling and linters
No change to runtime logic or behavior