Open mikkelgthang opened 2 months ago
I have the same issue, was any solution found? Not deploying Chainlit's UI would work, only if the react custom frontend is deployed in the same port (8000). But as per Willy's comment on issue 705, Chainlit's UI is always declared last and it cannot be overwritten.
@brii7 Unfortunately, there still seems to be no natively working solution available. For this reason, we opted for a manual "hacky" solution, where we post-package-install in our docker image simply replaces the chainlit/backend/chainlit /server.py
file with a modified duplicate, replacing url=f"/login/callback?{params}"
with our custom environment url's.
Thank you for your reply and solution. I've also just found out that changing the _custombuild paremeter on the config.toml file, enables you to use your own custom UI folder. But it needs to have a specific structure, which is also not 100% convenient.
@brii7 it seems they have fixed this issue in their latest versioning 😄
I was a bit too fast on the trigger, they merely added support for the CHAINLIT_ROOT_PATH
, which is a path appended to the base CHAINLIT_URL
, not directly transferrable to custom frontend URL. With their new mounted setup however, perhaps a better solution exists using fastapi overwrite.
When using
@cl.oauth_callback
as described in the docs,CHAINLIT_URL
can be set to define the backend's URL - which works as expected. However, theRedirectResponse
defined in oauth_callback simply callsurl=f"/login?{params}"
, which means that the callback url wrongly uses the CHAINLIT_URL, and not the frontend's URL that made the request. I can see that it includes aFIXME
comment, but in case other matters are more pressing, is there potentially any way to overwrite the implementation? I tried to define the same endpoint in myapp.py
file, but it still uses the internal function. Currently, I have no way of returning the token to my custom frontend url detached fromCHAINLIT_URL
. 😃Thank you in advance 👏