https://supertokens.com/ logo
Electron app issue
d

djarran

03/11/2023, 1:04 PM
hello! my electron app is working fine using my local express server. using my production server, i am able to log in and log out, with cookies being set and sent correctly to the signinup and signout endpoints. all other requests to my own endpoints, cookies are not sent or set. they are still stored in localstorage using the custom cookieHandler from the example on github
r

rp

03/11/2023, 1:09 PM
Hey @djarran
@nkshah2 can help here when he is available.
d

djarran

03/11/2023, 1:26 PM
okay, no problem
n

nkshah2

03/13/2023, 6:37 AM
Hi @djarran , Can you share the full config you pass to supertokens init in your electron app?
d

djarran

03/14/2023, 10:47 AM
sure
if (typeof window !== "undefined") { supertokens.init({ appInfo: { appName: "", apiDomain: process.env.REACT_APP_API_BASE_URL, websiteDomain: process.env.REACT_APP_CLIENT_URL, apiBasePath: "/auth", websiteBasePath: "/auth" }, cookieHandler: getCookieHandler, windowHandler: getWindowHandler, recipeList: [ ThirdPartyEmailPassword.init({ contactMethod: "EMAIL", signInAndUpFeature: { providers: [ Github.init(), Google.init(), Facebook.init(), Apple.init(), ] }, preAPIHook: async (context) => { let url = context.url; // is the fetch config object that contains the header, body etc.. let requestInit = context.requestInit; let clientType = window?.env?.clientType || 'webapp' if (context.action === 'GET_AUTHORISATION_URL') { let newUrl = context.url +
&clientType=${clientType}
context.url = newUrl return context } return { requestInit, url } }, onHandleEvent: async (context) => { if (context.action === "SESSION_ALREADY_EXISTS") { } else { if (context.action === "SUCCESS") { }} }}), Session.init() ] }); }
n

nkshah2

03/15/2023, 5:20 AM
Are you using fetch or axios for your network requests?