Hello, i need to configure the backend for to accept capcitor://app.id URL and not only http or https.
Someone can help me?
06/24/2022, 5:10 PM
Hey @Biaz give me sometime. I’ll help
06/24/2022, 5:14 PM
We set cookieHandler: getCookieHandler,
windowHandler: (original) => getWindowHandler(original, config),
As u said to us before.
And it works with API on http://localhost:3000 from http://localhost and from capacitor://appId
If we use on API:
From capacitor://appID to https://apiDomain we recive this error:
"Since your API and website domain are different, for sessions to work, please use https on your api Domain and don't set cookie Secure to false."
If we set cookieSecure: true we cannot call API from capacitor://appID
06/24/2022, 6:06 PM
right. So how much have you gotten it to work already?
Hello, We have noticed that both our cookie-handler and window-handler seems to be working properly.
The signin API return the header 'Set-Cookie' with the appropriate value, but the header appended to subsequent requests (es. 'auth/user/email/verify') is the following: "Cookie: sIRTFrontend=remove".
This situation occurs only for app that is running in a WebView hosted with Capacitor, in normal browser all works fine.
I think the problem could be with Supertokens.addAxiosInterceptor() because before the unauthorized response error the cookies exist correctly.
Could you help me? Can i use a custom Interceptor to solve this issue?
06/28/2022, 5:12 PM
Hmmm. Is there some api request that results in the cookies getting removed?
06/28/2022, 5:35 PM
The cookies seems to be removed after an api responds with status 401
ok, maybe i understand the real problem.
IOS app that use capacitor are unable to use the document.cookie with Secure cookies.
Is document.cookie used by AxiosInterceptor??
In this case i have to write my custom interceptor to override this behavior to use Http.setCookie by capacitor-communty/http plugin that seems to solve the problem
06/28/2022, 6:03 PM
Yeaa. You might want to provide a custom cookie handler then