nodeSolidServer/solid-auth-client

When using Login(), currentSession remains null

james-martin-jd opened this issue · 5 comments

The popup login call is working fine, but recently (as far as I can tell, without changing versions of solid-auth-client as this even affected older code) the login() call has started behaving oddly. The call succeeds, and I can see the localStorage object being created with relevant data, but currentSession (or any variation of getting the current session) returns null. This means for all intents and purposes I'm not authenticated even though the login succeeded.

I added regular login to the demo app in 506c281 and followed the steps here https://github.com/solid/solid-auth-client/tree/v2.2.13#demo-app to start the demo app. Login with and without popup works for me.

Can you provide exact steps for the above behavior?

The exact call we're using is:
await auth.login(idp, { callback, storage: localStorage });

When doing it this way, login succeeds, but any subsequent attempts to load session error our as the session is null. An example call that returns null after this login is auth.currentSession();

So I could imagine some concurrency bugs that might lead to such behavior, which I have addressed in dc34a3c and b3f9fcd and released as v2.2.14.

Would these by any chance fix what you're seeing?
If not, I'll need minimal example code that showcases the bug.

I pulled the latest version (and confirmed it's running) but the error still persists unfortunately. I will provide code sample shortly.

This error eventually went away on its own. We suspect there was some kind of cached item that was corrupt somehow. This happened on multiple machines with multiple users, but it has not recurred since.