inrupt / inrupt/solid-client-authn-js
Provide session or sessionInfo to onLogin callback
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 77
- Forks
- 49
- Avg merge
- 18h 20m
- Merged PRs (30d)
- 32
Description
Search terms you've used
session, sessionInfo, onLogin
Impacted environment
In which environment would the proposed feature apply ?
- The browser
- Node.js (Though mostly the browser)
- Other (please specify): ...
- I'm not sure.
Feature suggestion
When using the default session, it would be nice if I could access the sessionInfo, or possibly even the entire session, from the callback handler passed to onLogin.
Expected functionality/enhancement
import { onLogin } from "@inrupt/solid-client-authn-browser";
onLogin((sessionInfo) => {
console.log("This should be a safe operation:", sessionInfo.webId);
});
Actual functionality/enhancement
Currently you have to add another call to getDefaultSession() in the callback, and a type checker cannot statically verify that its webId property is set and isLoggedIn is true.
Use Cases
I've got a central place in my app that keeps track of the user's session, and I update it whenever a login or logout event is thrown.
Additional information
N/A
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the onLogin callback and getDefaultSession entry points in the TypeScript authentication code, then inspect how sessionInfo and the default session are typed. Define the callback contract so it receives the requested session information, and verify that the webId and logged-in state are represented safely for login handlers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100