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

failed to fetch user profile #9

Open
CarlShi1995 opened this issue Aug 10, 2021 · 1 comment
Open

failed to fetch user profile #9

CarlShi1995 opened this issue Aug 10, 2021 · 1 comment

Comments

@CarlShi1995
Copy link

Hi there, I have tried setting up the strategy and get my authorization page sucessfully. But somehow after I clicked the allow access. It always said Error (400): failed to fetch user profile. Could someone encounter the issue? Thanks

@antl3x
Copy link

antl3x commented Jul 13, 2022

Figma Servers are behind CloudFlare, and the oauth2 package is sending an invalid Content-length header on a GET request, which is invalid. We need to intercept the function and remove this header with Proxy.

(this._oauth2 as any)._executeRequest = new Proxy((this._oauth2 as any)._executeRequest, {
        apply: (target, _, paramsArr) => {
          delete paramsArr[1]['headers']['Content-length']
          return target(...paramsArr)
        }
      })

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

No branches or pull requests

2 participants