keycloak / keycloak-nodejs-connect

Apache License 2.0
676 stars 421 forks source link

keycloak.logoutUrl do not include the redirectUrl unless the idTokenHint is also passed #461

Open francois-roget opened 1 year ago

francois-roget commented 1 year ago

Describe the bug

When using the Keycloak-connect npm package, there is a function to generate the logout url: keycloak.logoutUrl. According to the typescript types, it accepts 2 parameters:

Calling this method with only the mandatory parameter does not gives the expected output.

Version

20.0.2

Expected behavior

When only the mandatory parameter redirectUrl is passed to the function, the generated logout url should contain it.

Actual behavior

The redirectUrl parameter does not get added to the generated logout url unless the optional idTokenHint is passed as well. In this case, both are added to the generated url.

How to Reproduce?

Get a configured setup of keycloak-connect and call the method keycloak.logoutUrl with only 1 parameter. In that case, the parameter value does not get found in the generated logout url

Anything else?

I'll create a PR to fix this