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

field refreshToken is not async safe #337

Open
nrbnlulu opened this issue Jul 21, 2022 · 3 comments
Open

field refreshToken is not async safe #337

nrbnlulu opened this issue Jul 21, 2022 · 3 comments
Assignees
Labels
breaking Breaking Changes bug Something isn't working python Pull requests that update Python code

Comments

@nrbnlulu
Copy link

nrbnlulu commented Jul 21, 2022

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.

def create_refresh_token(user, refresh_token=None):

@nrbnlulu
Copy link
Author

@KundaPanda Any updates on that?

@KundaPanda
Copy link
Owner

Yes I have tracked down some code that might cause this, looking into it now.

@KundaPanda KundaPanda self-assigned this Jul 26, 2022
@KundaPanda KundaPanda added bug Something isn't working python Pull requests that update Python code breaking Breaking Changes labels Jul 26, 2022
@nrbnlulu
Copy link
Author

Would you mind to create a release for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking Changes bug Something isn't working python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants