Breaking changes in version 0.2.1+
This library does not respect Semver as it introduces breaking changes in its version 0.2.1 :
The default token name as been changed, breaking all applications that were depending on the default token name for their authentication.
I suggest two options :
- Support both token name, deprecating the first one but still fallback to it if the new token name cannot be found
- Respect semver and change the MAJOR version when releasing a breaking change
For the first option, I can work to do a pull request when I have time.
+1, just got a bunch of auth errors after doing a fresh npm install and traced it back to the token name change! My version went from 0.2.0 -> 0.2.2
From what i have seen, the tokenNotExpired() method is not working correctly after updating 0.2.0 -> 0.2.2
Yes, by default looks like it takes token as name.
If someone wants to keep his token name, just change the service factory:
export function authHttpServiceFactory(http: Http, options: RequestOptions) {
return new AuthHttp(new AuthConfig({
tokenName: 'id_token',
globalHeaders: [{ 'Content-Type': 'application/json' }],
}), http, options);
}
and the authenticated method, pass as argument the name
tokenNotExpired(`id_token`)
@tomtobac yeah it works that way - i was just wondering why do we have to pass the token name in tokenNotExpired() method if we have already declared it in AuthConfig factory function. Shouldn't it pick from there automatically?
@hassanasad Yes, you are right. I don't know why but I guess it should take it from there... I am wondering why not :thinking:
I think the point of this issue is that you made backwards breaking changes, but only updated the patch number which should definitely not having breaking changes.
This library does not respect Semver as it introduces breaking changes in its version 0.2.1
FYI, SemVer treats major version zero a little different:
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
It's still convention that the minor version should change for breaking changes with major version 0. I don't know why it changed, or why it was done without any warning. I suspect it was to align better with the jwt spec.