Hey guys, it seems my bearer token is saving but when I get the HTTP cookie it doesn't get pass the value to the my following api calls. It was working earlier. Any ideas, why this might be?
@NoCode ProCode I am uisng an edge function
Erik Beuschau
5 months ago
If you set the cookie using the set session cookie action in toddle, the cookie will be a same site cookie. Therefore, you need to make sure you proxy your API request through toddleβs backend. Check under βadvancedβ on your API call
0xJam3s
5 months ago
Thanks @Erik Beuschau- I do have the proxy setting enabled on the advanced tab
Erik Beuschau
5 months ago
I see. Itβs a bit tricky to debug without more details. Perhaps you could send me instructions on how to reproduce? If the project is public, you can just send me the link to your project π€
0xJam3s
5 months ago
I have sent you a link to the project in a DM mate, thanks! @Erik Beuschau
codenitrr
5 months ago
I have also struggled with this several times. I was able to solve it by reinstalling the Toddle Chrome plugin. No idea if it helps with you too, but thought I'd mention it
π1
0xJam3s
5 months ago
Thanks @- yesterday I did do that and it fixed my issue. Not this time though, and it's not working on the staging site either
Lucas G
5 months ago
The extension will only affect the editor having access to the cookie
The actual call should have it regardless as long as the proxy is turned on
0xJam3s
5 months ago
When I check network in log I see: authorization: Bearer {{ cookies.access_token }} content-type: application/json cookie: access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6Ikd3cmhRV1ZMSitYWFZLNysiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FhaHRuZ29tb3BzZmFudHN4ZXR0 Why does the cookie exist there? Surely it defeats the point i the {{ cookies.access_token }}?
Lucas G
5 months ago
Assuming the cookie was correctly set/is not expired
But it includes also cookie: access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6Ikd3cmhRV1ZMSitYWFZLNysiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FhaHRuZ29tb3BzZmFudHN4ZXR0...
Lucas G
5 months ago
The call will have it correctly on the backend
0xJam3s
5 months ago
All sorted thanks to Eric. I was running GO TO URL at the same time as updating the access token. I should have been updating the access token on success of the event. Thanks guys