strawberry-django-jwt
strawberry-django-jwt copied to clipboard
field `refreshToken` is not async safe
consider this query
obtainPayload {
payload {
origIat
exp
username
}
refreshExpiresIn
# no refresh token here
token
}
Works fine.
But this one:
mutation obtainJWT {
obtainPayload {
payload {
origIat
exp
username
}
refreshExpiresIn
refreshToken // <<<
token
}
}
gives this error
"errors": [
{
"message": "You cannot call this from an async context - use a thread or sync_to_async.",
"locations": [
{
"line": 11,
"column": 7
}
],
}
]
This is possibly the line. https://github.com/KundaPanda/strawberry-django-jwt/blob/17d520efcb1f2e2cfefc2744d283b7c93ea8d540/strawberry_django_jwt/refresh_token/shortcuts.py#L24