Skip to content

refactor: use AbstractBaseUser instead of AbstractUser for compatibility#133

Merged
eadwinCode merged 1 commit into
eadwinCode:masterfrom
Aidan79225:feature/auth-user
May 22, 2025
Merged

refactor: use AbstractBaseUser instead of AbstractUser for compatibility#133
eadwinCode merged 1 commit into
eadwinCode:masterfrom
Aidan79225:feature/auth-user

Conversation

@Aidan79225
Copy link
Copy Markdown

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