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

[Issue #3499] Make user token session typing cleaner #3516

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

chouinar
Copy link
Collaborator

@chouinar chouinar commented Jan 14, 2025

Summary

Fixes #3516

Time to review: 3 mins

Changes proposed

Add a utility method for fetching the user token session to handle type checking issues.

Context for reviewers

This removes the need to have api_jwt_auth.current_user # type: ignore in every place we fetch the user.

Note that we have to do some sort of type ignore/cast because the type is None | Any on current_user as it's just whatever you return from the decode_token method.

Additional information

All tests continue to pass which rely on fetching this

@chouinar chouinar requested a review from mdragon as a code owner January 14, 2025 16:39
@chouinar chouinar merged commit 158a768 into main Jan 14, 2025
2 checks passed
@chouinar chouinar deleted the chouinar/3499-jwt-user branch January 14, 2025 17:51
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