Hi, I’m using the new library solid-client-authn-browser
to create the authentication method of my app, and I can’t manage to make it work.
I’ve followed this guide that Inrupt provides, and here’s my code:
export function initLogin() {
if (!getDefaultSession().info.isLoggedIn) {
return login({
oidcIssuer: solidProviders.INRUPT,
redirectUrl: propertiesSolid.redirectUriLogin
});
}
}
export async function handleAfterLogin() {
await handleIncomingRedirect(propertiesSolid.redirectUriLogin);
const session = getDefaultSession();
console.log(session);
// SolidCache.getInstance().setSolidSession(getDefaultSession())
}
The second function handleAfterLogin
is called at the page where the user must be redirected after login, but the getDefaultSession()
property returns the following:
1. info:
1. isLoggedIn: false
2. sessionId: "8ef427a6-ea6c-4d3d-af19-64f215f985e1"
3. webId: undefined
4. __proto__: Object
And even when I refresh the webpage, the property isLoggedIn
is always false.
Why is this happening?