homer
homer copied to clipboard
qBittorrent custom service
Hey guys, I'm planning on creating a custom service for qBittorrent soon.
I noticed that its API only uses cookie-based authentication, and since I'm not a js guy I wanted to hear some opinions/best practices on how to implement some sort of persistency between requests, ideally without adding dependencies to the project.
For example, would localStorage be a good fit? If so, how should it be used within the context of this project?
Thanks!
Hey there,
Hum, cookie based auth is not the best. When used client side in ajax request you might have issues regarding the domain associated with the cookie :thinking: Usually the persistence of cookies is seamlessly assured by the browser, and it's content automatically send to the server with all request.
You can use localStorage, Homer already use it for some settings here and here, but i'm not sure it can help with the cookie.
I don't know about qbittorrent, they might have some documentation on this?
Their docs are quite good. Unfortunately it seems that only cookie-based auth is supported.
I also checked out how Heimdall does things, and you guessed it, it uses cookies as well. Doing it with localStorage does feel hacky to be honest, that's the reason I opened this issue after all.
Oh well, I'll do some tests and see how it goes!