Skip to content
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

Type for BlacklistMixin.for_user() Needs to be enhanced for RefreshToken usage #767

Closed
Dresdn opened this issue Dec 4, 2023 · 0 comments · Fixed by #768
Closed

Type for BlacklistMixin.for_user() Needs to be enhanced for RefreshToken usage #767

Dresdn opened this issue Dec 4, 2023 · 0 comments · Fixed by #768

Comments

@Dresdn
Copy link
Contributor

Dresdn commented Dec 4, 2023

When using RefreshToken.for_user(), the static type of Token is returned. This should be improved to return the type of the Token subclass. Mypy is throwing the errors with v5.3.1:

error: "Token" has no attribute "access_token"

Example:

refresh = RefreshToken.for_user(user)

type(refresh) # RefreshToken
reveal_type(refresh) # Token

refresh.access_token # mypy error: "Token" has no attribute "access_token"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant