Giter VIP home page Giter VIP logo

Comments (4)

frederikprijck avatar frederikprijck commented on June 2, 2024

Thanks for reporting. The SDK has always had a public API that made it look like it supported promises to retrieve the token, but it actually didnt, see #747 .

This has been fixed in #748 and released with the latest patch version. This could break people, but it's fixing incorrect behavior in the SDK so I believe this breaking change is justified in a patch given it's actualy fixing a bug.

In general our rule is to follow semantic versions. But when the SDK currently isn't doing what it's saying it does, I believe we should fix this rather than release a new major version only to ensure the SDK correctly does what it says it does.

Important to note tho is that, even though the return type of decodedToken has changed, if tokenGetter isn't set to return a Promise, it should still return T and not Promise<T>, making this a breaking change (or well, a breaking fix) in terms of the types, but not on the functionality.

Promises have always been involved in the decodedToken in the scenario were tokenGetter would return a Promise, however the types never reflected that and the SDK didn't work as expected as the decodeToken never considered the fact that the SDK allowed for tokens to be retrieved asynchronously.

from angular2-jwt.

sysmat avatar sysmat commented on June 2, 2024

ok, @frederikprijck thx for reason

from angular2-jwt.

frederikprijck avatar frederikprijck commented on June 2, 2024

Thanks again for reporting, I do believe we made a couple of mistakes with this release, apologies.

Looking into rectifying through #759, feel free to have a look.

from angular2-jwt.

frederikprijck avatar frederikprijck commented on June 2, 2024

Publish v5.1.2, which should revert some unnecessary breaking changes, but there are still scenario's that will be broken. But that should be the scenario's that were broken before 5.1.1. as well, and needed the fix in 5.1.1/5.1.2.

from angular2-jwt.

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.