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
1 month ago
Dec 10, 2024, 6:52 PM
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
1 month ago
Dec 10, 2024, 6:55 PM
Thanks @Erik Beuschau- I do have the proxy setting enabled on the advanced tab
Erik Beuschau
1 month ago
Dec 10, 2024, 6:57 PM
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
1 month ago
Dec 10, 2024, 7:06 PM
I have sent you a link to the project in a DM mate, thanks! @Erik Beuschau
codenitrr
1 month ago
Dec 10, 2024, 7:11 PM
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
1 month ago
Dec 10, 2024, 7:17 PM
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
1 month ago
Dec 10, 2024, 7:21 PM
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
1 month ago
Dec 10, 2024, 7:22 PM
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
1 month ago
Dec 10, 2024, 7:22 PM
Assuming the cookie was correctly set/is not expired
But it includes also cookie: access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6Ikd3cmhRV1ZMSitYWFZLNysiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FhaHRuZ29tb3BzZmFudHN4ZXR0...
Lucas G
1 month ago
Dec 10, 2024, 7:23 PM
The call will have it correctly on the backend
0xJam3s
1 month ago
Dec 10, 2024, 8:14 PM
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