Upon user login, an HTTP-only cookie is set for user authentication.
1.A bot is loaded as an embedded iframe.
2. Users can perform certain operations through the bot, such as setting their phone number. These operations are typically handled on the front end.
3. Each request requires the authentication token, which is stored as a session cookie. This cookie is HTTP-only and, therefore, not accessible by frontend JavaScript. However, the browser includes it automatically in each request.
4. When executing some code in the Botpress code card, users enter their phone number and submit it. The code is executed upon submission, but it fails because the API requires the cookie for user authentication which is not sent in /message api of botpress and I cant send from frontend because its http-only cookie.
Issue:
The API call from the Botpress code card is failing because it cannot access the HTTP-only cookie needed for user authentication.
Solution Required:
How can this issue be resolved so that the API can successfully detect the user and complete the operation?