-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle multiple logins #117
Comments
Not yet. There are indeed some use cases where this would be useful. |
Ok, thanks for your fast response. Do you mean that it is not possible or just not implemented yet? If it is latter, I could take a look at it in the next days and try to implement it :) |
It's possible, but not implemented yet. I'd be very happy if you could take a look at it, but I'm pretty sure it will take a substantial effort, given that the interface the library would have to change. I would consider this a major rewrite. |
I think the interface itself doesn't need to change much, "only" the underlying code would need to be refactored. I would have thought of wrapping the functionality into a class, which then can be created multiple times. And to keep backwards compatibility a default instance could be created. So from the users point of view I would propose something like this: const auth = require('solid-auth-client');
const defaultSession = auth;
const myFirstSession = auth.createNewSession();
const mySecondSession = auth.createNewSession();
await defaultSession.login(idp);
await myFirstSession.login(idp);
await mySecondSession.login(ipd);
await defaultSession.fetch(url, options);
await myFirstSession.fetch(url, options);
// And so on... I will take a look at it in the next few days and notify you if I manage to get it working or not. I won't start until tomorrow, so if you have any suggestions or tips it would be nice if you could make them in this time span :) |
But…
…that is a substantial interface change 😉 The good thing is that part of the refactoring you need for this already exists, in that |
Is there a way to handle multiple logins simultaneously?
In my filemanager (this one) this could be used to transfer files between two private pods without the need to download them. For other applications this could be helpful for easily switching between different accounts, or accumulating data from two or more.
And if not, do you know if it would be possible to tweak (a fork of) this package to do this, or if it isn't possible because of server side restrictions?
The text was updated successfully, but these errors were encountered: