No state in response after callback in oidc-client-js

If you are doing something custom like me and your issue has nothing to do with hash location, just ignore it:

  completeAuthentication(): Promise<void> {
    return this.manager.signinRedirectCallback().then(user => {
      this.user = user;
    }).catch((err) => {});
  }

It is caused by URI encoding of state in the window.location.hash. For me this fix the issue:

if (window.location.hash) {
window.location.hash = decodeURIComponent(window.location.hash);
// authorizedCallback returns wrong result when hash is URI encoded
this.oidcSecurityService.authorizedCallback();
} else {
this.oidcSecurityService.authorize();
}