mauriciovigolo / keycloak-angular

Easy Keycloak setup for Angular applications.
MIT License
730 stars 280 forks source link

HttpClient Interceptor example TS error #499

Open Sulyci opened 1 year ago

Sulyci commented 1 year ago

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

keycloak-angular: 14.0.0 angular: 16.0.0 keycloak: 21.1.1 typescript: 5.0.2

Repro steps.

Go to this section: (https://www.npmjs.com/package/keycloak-angular#httpclient-interceptor) Copy the shouldUpdateToken attribute:

shouldUpdateToken(request) {
  return !request.headers.get('token-update') === 'false';
}

Paste it as the example says. Then you should have a TS2367: This comparison appears to be unintentional because the types 'boolean' and 'string' have no overlap. error on return !request.headers.get('token-update') === 'false'; line

The log given by the failure.

TS2367: This comparison appears to be unintentional because the types 'boolean' and 'string' have no overlap.

Desired functionality.

I would like to see a code without TS error.

puranjayjain commented 1 year ago

I'm also facing the same issue, basically my interceptor and the keycloak interceptor both don't work together