https://supertokens.com/ logo
c

codingtomato

05/23/2022, 3:01 PM
Does anybody know what I have to do to get an electron app to send cookies in a fetch request? (Backend secured with Supertokens)
r

rp

05/23/2022, 3:02 PM
Hey! Nothing special as such. We have an example app with electron that you can check out
c

codingtomato

05/23/2022, 3:02 PM
would be great
c

codingtomato

05/23/2022, 3:16 PM
For some reason it doesnt set the sFrontToken after Logging in
Is there a reason why you use Axios instead of Fetch?
r

rp

05/23/2022, 3:17 PM
Fetch should work too
Can I see what appInfo you have given?
c

codingtomato

05/23/2022, 3:19 PM
Okay I have to correct me... After logging in the token gets set but after hitting an endpoint it removes it ... Probably due to the refresh not working?
What do you mean exactly? Sorry that I dont know
r

rp

05/23/2022, 3:20 PM
Well. Can you enable frontend and backend debug logging and show me the output?
c

codingtomato

05/23/2022, 3:20 PM
The first request after logging in
yes... just a moment
do you mean this?
r

rp

05/23/2022, 3:25 PM
No
There is a section on the docs called troubleshooting. See that
c

codingtomato

05/23/2022, 3:26 PM
ah now i see
okay backend debug mode works... but on the frontend it says that enableDebugLogs is not available
r

rp

05/23/2022, 3:35 PM
Can you upgrade to the latest version of the frontend SDK?
c

codingtomato

05/23/2022, 3:38 PM
okay works now... what part of the logs do you need... all of them?
r

rp

05/23/2022, 3:38 PM
Yup
So it seems the cookies are not being sent in the request
What is your request URL?
Oh right. I see the problem
You are querying cross origin
For it to work, you need to use https://localhost:5000 in your api domain (https not http)
Either that, or set the frontend and backend domains on the same domain
c

codingtomato

05/25/2022, 1:15 PM
That worked, thank you!
3 Views