keycloak / keycloak-nodejs-connect

Apache License 2.0
676 stars 421 forks source link

Fix generate cleanUrl in post-auth.js with hostname #390

Open devromarus opened 2 years ago

devromarus commented 2 years ago

Description

Function postAuth can't redirect to full cleanUrl.

Because we have an app name after the hostname and current version redirect with error.

Our url: http://host-name/app-name/path

Redirect url in current version: http://host-name/path

Add generation for redirect as in protect.js

const host = request.hostname
  const headerHost = request.headers.host.split(':')
  const port = headerHost[1] || ''
  const protocol = request.protocol

  const redirectUrl = protocol + '://' + host + (port === '' ? '' : ':' + port) + cleanUrl

Discussion

No response

Motivation

No response

Details

391

zingmane commented 3 months ago

I am in the same situation. This issue with PR (#391) fixing it is open for a very long time. Is it planned that this will be merged at some point?