User story around on cookies + authentication #5337
Unanswered
Nickersoft
asked this question in
Q&A
Replies: 1 comment 4 replies
-
...does no one else have this problem? 😭 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks,
I've been toying with the idea of porting my SvelteKit app to a Tauri app for some time now (while still keeping a version on the web), and am confused about the user story regarding cookies + network authentication in Tauri. I couldn't find any solid docs on it, and am curious how other people are managing their apps.
Right now user authentication in my app is very straightforward:
Secure
cookie specific to my app's domainHowever, in the world of Tauri, this approach seems to break down. Tauri apps run off
tauri://localhost
, which is neither aSecure
origin (from my understanding), or a valid domain name. AFAIK my cookies will never be set. There's also the issue of CORS, which I tried to disable by settingcsp
tonull
, but it didn't seem to work when I tried, plus it just feels wrong.I tried using the Tauri
http
module to circumvent it, but it's not compatible with SvelteKit'sfetch
signature (though I know this will be fixed by #5136). I tried using the store plugin, but its reliance onwindow
makes it impossible to run server-side, which breaks SvelteKit'sdev
server.Regardless, trying to balance both cookie-based and store-based authentication resulted in a ton of messy boilerplate as I tried detecting the environment the app was being run.
Anyway, I was surprised to see there is not a user story around this detailed in the Tauri docs. I'm curious how other people are managing similar setups.
Beta Was this translation helpful? Give feedback.
All reactions