Hey,
I use nodebb-plugin-session-sharing to automatically login users from my WebApp.
This works great on desktop!
But when I add the cookie to WebView of my React Native app i get:
Encountered an error loading page
code: -1007
description: "too many HTTP redirects"
didFailProvisionalNavigation: true
domain: "NSURLErrorDomain"
I inject the cookie by calling
<WebView
source={{
uri: domain,
headers: {
Cookie: `${tokenName}=${token};Domain=${tokenDomain};HttpOnly;`},
}
}
/>
When I remove the cookie from the header and reload the app on Simulator, I'm logged in, so the cookie and the plugin mechanism is basically working.
React Native WebView reference
nodebb-plugin-session-sharing on Github
Anyone an idea about this?
Kind regards
Niklas