hoist-react
hoist-react copied to clipboard
`XH.clientAppCode` should be defaulted by dev-utils
Currently clientAppCode
can be set via AppSpec
to any value, and is defaulted to the overall project-level appCode
. Unfortunately our new BaseOauthClient
expects clientAppCode
to match the base route of the app - e.g. admin
for the admin console app:
https://github.com/xh/hoist-react/blob/1bec2c2b748a9b684e8511cd6c4479c41bf3fd5b/security/BaseOAuthClient.ts#L231
This means that, for those baseUrls to work, devs must always spec a code that matches the name of the bundle entry-point file under client-app/apps/
.
We should update hoist-dev-utils to define an xhClientAppCode
magic const like the others:
https://github.com/xh/hoist-react/blob/1bec2c2b748a9b684e8511cd6c4479c41bf3fd5b/core/XH.ts#L101
and set it to the bundle entry-point. We could discuss if we need to support overriding that code, but I don't think we should. One important note however is that these client app codes are used by some other services such as alert banner presets and auto-refresh + idle configs. We should have a warning in the changelog to indicate that these should be reviewed and adjusted if an app code was previously spec'd that differs from the bundle name.