Skip to content

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

Open
@francois-roget

Description

@francois-roget

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:

  • redirectUrl: string (mandatory)
  • idTokenHint?: string (not-mandatory)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions