icloud.js icon indicating copy to clipboard operation
icloud.js copied to clipboard

Browser & persistent authentication support

Open cdloh opened this issue 9 months ago • 2 comments

Hi @foxt 👋

Love the project and your work here. I was really interested in adding web support to the lilbrary and persistent authentication.

I'd like to use the Library in Obsidian which is built on Electron. I was planning on adding the following functionality.

  1. Add persistent authentication support to AuthStore (store the various cookies etc on the FS) Have to handle session expiry as well.

  2. Extend AuthStore to be able to have a few different stores For web support I would create one that used LocalStorage

  3. Rework remaining NodeJS requirements

Would you be interested in adding this functionality? I'm happy to do this work but want to check before doing the work.

cdloh avatar May 08 '25 14:05 cdloh

Hi, supporting browser use is an interesting possibility, however, wouldn't CORS cause issues?

FWIW: I was planning a rewrite for more modularity (including being able to provide your own handlers for network & persistence) however I haven't had chance to actually write much code for it. I'll see if I can sit down with it and get something to show for it

foxt avatar May 08 '25 14:05 foxt

It wouldn't be true browser support (at least for my use case) as Obsidian puts wrappers around fetch to get around CORS issues. You are correct in there being cors issues but most people disable it in Electron apps AFAIK.

If you're looking at making it more modular that would be excellent. I'm mainly looking at just interacting with the Apple Photos for embedding support.

cdloh avatar May 08 '25 14:05 cdloh