-
Notifications
You must be signed in to change notification settings - Fork 1
Use Async Storage API in favor of synchronous mutable storage API #40
base: master
Are you sure you want to change the base?
Conversation
Did folks get a chance to look at this? This would directly unblock nodeSolidServer/solid-auth-client#24 and nodeSolidServer/solid-auth-client#19 |
What's the use case / requirement for async storage? (Server-side and webworker auth would still work fine in the current setup, if you pass along the serialized session to the webworker). |
As I mentioned, the use case is to be able to run this library within a context where there is no access to a synchronous IO interface like
The problem is that we'd then have to deserialize the session from the Some thoughts:
|
The popup window should not be using an RP instance (that is way too heavyweight); the popup's only function is to help the user select the provider, and post that url back to the parent window (where the RP client creates the authz url and redirects the popup to it). But even if your architecture requires that the popup window uses the RP client, see the web worker discussion below.
Once the user logs in, no RP instance is actually needed for authenticated fetches. (The PoPToken.issueFor() method that the authenticated fetch uses is a static method.) So the workflow would go, roughly:
After login, no further mutations are made to the Session object, and none of these workflows require async storage. |
This change enables this library to work in contexts where
localStorage
is not available (e.g. a web worker or in a popup window which has to ask its parent to store data usingwindow.postMessage
).