Skip to content

refactor: use AbstractBaseUser instead of AbstractUser for compatibility #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

Aidan79225
Copy link

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

@eadwinCode eadwinCode merged commit 4560581 into eadwinCode:master May 22, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants