You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to get a cookie (from a server with another app) through an "execute on client" HTTP request. The cookie is sent in the response from the server, but not stored by the browser.
Analysis
For the browser to store the cookie, we need credentials: 'include' with the fetch. This is not present
try{letn=typeofe=="string" ? e : e.url;t=awaitfetch(n,{method: typeofe=="string" ? "GET" : e.method,mode: "cors",credentials: 'include',// Include cookies with the requestheaders: typeofe!="string"&&re(e.body) ? {"Content-Type": "application/json"} : void0,body: typeofe!="string"&&re(e.body) ? JSON.stringify(e.body) : void0});letr=awaitt.json();if(!t.ok)throw"error"inr ? r.error : r;return{data: r,response: t}}catch(n){returnconsole.error(n),{error: n,response: t}}
and
try{leti=awaitfetch(t,{method: n,credentials: 'include',// Include cookies with the requestbody: n!=="GET"&&r ? JSON.stringify(r) : void0,headers: o}),a=i.status,s=awaiti.json();returnJSON.stringify({statusCode: a,data: s})}catch(i){returnconsole.error(i),JSON.stringify({statusCode: 500,data: "An error occured while executing the webhook on the client"})}
The text was updated successfully, but these errors were encountered:
Describe the bug
I am trying to get a cookie (from a server with another app) through an "execute on client" HTTP request. The cookie is sent in the response from the server, but not stored by the browser.
Analysis
For the browser to store the cookie, we need
credentials: 'include'
with the fetch. This is not presentFix / Proof of concept
When I add the
credentials: 'include'
to web.js (https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js) in these two places (lines 4454 ff. and 13092 ff. for me), all works nicely:and
The text was updated successfully, but these errors were encountered: