-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix async refresh #342
Fix async refresh #342
Conversation
Codecov Report
@@ Coverage Diff @@
## master #342 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 32 32
Lines 1082 1099 +17
Branches 180 185 +5
=======================================
+ Hits 1080 1097 +17
Partials 2 2
Continue to review full report at Codecov.
|
@@ -39,5 +39,13 @@ class Mutation: | |||
delete_cookie = jwt_mutations.DeleteJSONWebTokenCookie.delete_cookie | |||
|
|||
|
|||
schema = Schema(query=Query, mutation=Mutation, extensions=[AsyncJSONWebTokenMiddleware]) | |||
@strawberry.type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that required (RefreshAsync
) or just for readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RefreshAsync will be required, the refresh token db access is done inside the resolver so it must be wrapped in sync_to_async. Obtain handles this in decorators where it is already async safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other are just for consistency
Async refresh was currently somehow broken. This fixes it and adds explicit async resolvers for clarity.
#337