p2-inc / phasetwo-admin-portal

https://phasetwo.io
Other
18 stars 14 forks source link

wrong url of css and scripts when opening portal #87

Closed paulwer closed 1 year ago

paulwer commented 1 year ago

when opening the admin-portal at: https://phase-two-instance.com/realms/master/portal/ the resources are fetched from:

<script defer="defer" src="/auth/realms/master/portal/static/js/main.a5619124.js"></script>
<link href="/auth/realms/master/portal/static/css/main.2f5be0a3.css" rel="stylesheet">

the right url would be: (without /auth, checked the urls and they serve files)

<script defer="defer" src="/realms/master/portal/static/js/main.a5619124.js"></script>
<link href="/realms/master/portal/static/css/main.2f5be0a3.css" rel="stylesheet">

have I did something wrong within my configuration or is this a bug?

an other header is:

<base href="/auth/realms/master/portal/"/>
cedric-beurtheret-jcd commented 1 year ago

I think the error comes from config.ts - Line 99

paulwer commented 1 year ago

old keycloak instances has used the /auth prefix. any chances to fix this in the next release?

paulwer commented 1 year ago

@xgp is there an upcomming change for us in the pipeline?😊

xgp commented 1 year ago

@paulwer Customers are all using /auth relative path URL so this is low priority. Feel free to PR the fix.

paulwer commented 1 year ago

@xgp i added a simple check, if the pathname includes /auth/ or not, to support old / your versions and newer keycloak versions, when installing from dockerimage

please test, if this is not suiteable for you, you/we may have to considder take a look at the public docker image, why the portal is there visiable at /realms and not /auth/realms. what do you think?

xgp commented 1 year ago

Thanks. I merged, and I'll take a look when we release a new public docker image. TBH there's a lot of cases where we assume that /auth will be the relative path, as most of our work started before Keycloak removed that necessity. Because of that, our hosted version, and all of our customers use it. I'd like to wave a magic wand and have it fixed everywhere, but I'm afraid it will be a game of whack-a-mole for people that are using no/another relative path.

paulwer commented 1 year ago

@xgp i read this at keycloak before. maybe its time to migrate your applications to this new standard also. Or to implement at least the same behavior within the oss docker image.

Shall anyone create an issue / feature request out of this?