botpress / studio

The studio is the main interface you'll use to build and edit your chatbot.
https://botpress.com/docs/quickstart#conversation-studio
33 stars 37 forks source link

fix(auth): fix authenticating with cookie storage #372

Closed laurentlp closed 1 year ago

laurentlp commented 1 year ago

This PR fixes an issue where when the JWT token was stored in the cookie storage, the call to /env would fail with a 401. The request was denied because the window variable 'USE_JWT_COOKIES' was not set at this point.

To fix the problem, I renamed the /branding.js call to /public-env.js so that we can send any public environment variable to the front-end without authentication and passed the value of process.USE_JWT_COOKIES in it.