You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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:
constauth=require('solid-auth-client');constdefaultSession=auth;constmyFirstSession=auth.createNewSession();constmySecondSession=auth.createNewSession();awaitdefaultSession.login(idp);awaitmyFirstSession.login(idp);awaitmySecondSession.login(ipd);awaitdefaultSession.fetch(url,options);awaitmyFirstSession.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 :)
I think the interface itself doesn't need to change much
But…
constmyFirstSession=auth.createNewSession();
…that is a substantial interface change 😉
The good thing is that part of the refactoring you need for this already exists, in that solid-auth-client exposes a default instance of a class. So createNewSession would be creating more instances.
Activity
RubenVerborgh commentedon Apr 15, 2019
Not yet. There are indeed some use cases where this would be useful.
Otto-AA commentedon Apr 15, 2019
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 :)
RubenVerborgh commentedon Apr 15, 2019
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.
Otto-AA commentedon Apr 15, 2019
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:
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 :)
RubenVerborgh commentedon Apr 15, 2019
But…
…that is a substantial interface change 😉
The good thing is that part of the refactoring you need for this already exists, in that
solid-auth-clientexposes a default instance of a class. SocreateNewSessionwould be creating more instances.