Coder Social home page Coder Social logo

Comments (6)

ulybu avatar ulybu commented on June 9, 2024 1

Hi,

"@fusionauth/node-client": "1.16.0" => "@fusionauth/typescript-client": "1.17.0"

@mooreds edited, copy/pasted twice the same lib 🔝

from fusionauth-typescript-client.

mooreds avatar mooreds commented on June 9, 2024

Hiya!

Thanks for letting us know.

What version of the node client were you running previously? What version of the typescript client are you moving to?

from fusionauth-typescript-client.

ulybu avatar ulybu commented on June 9, 2024

Hi,

I think it could come from the fact that in the node-client lib the body is explicitly serialized with JSON.stringify queryString.stringify, which will effectively remove any undefined prop, like for instance scope if not provided to exchangeRefreshTokenForAccessToken

https://github.com/FusionAuth/fusionauth-node-client/blob/0a5c326adc097c85e3572244f70f25088e3de061/lib/RESTClient.js#L74

setFormBody: function(body) {
    this.body = queryString.stringify(body);
    this.header('Content-Type', 'application/x-www-form-urlencoded');
    this.header('Content-Length', Buffer.byteLength(this.body));
    return this;
},

Whereas in typescript-client (this repo) the missing JSON serialization means we're going to keep that scope key explicitly set to undefined.

Edit: JSON.stringify => queryString.stringify. Issue is still the same, queryString also removed any undefined props

from fusionauth-typescript-client.

mooreds avatar mooreds commented on June 9, 2024

That sure looks like a incompatibility to me. I'll take a look. We also welcome pull requests if you want to just patch DefaultRESTClient.ts.

from fusionauth-typescript-client.

ulybu avatar ulybu commented on June 9, 2024

We also welcome pull requests if you want to just patch DefaultRESTClient.ts

Ugh, that seems too risky to me because I don't know the reason why the dropped the queryString.stringify in the first place. I can't just assume that's an oversight, right? I might very well be breaking something for someone else by adding queryString.stringify

I could submit a PR and let you guys deal with that risk assessment?

from fusionauth-typescript-client.

mooreds avatar mooreds commented on June 9, 2024

No worries, I ended up submitting a PR (#32), so no effort needed on your part. Thanks again for reporting this.

from fusionauth-typescript-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.