SolidOS / SolidOS/solid-ui

Code does not check for session = null when obtaining webId

Open
#32 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

authentication input-needed
Dominant language
TypeScript
Stars
153
Forks
46
Avg merge
1d 8h
Merged PRs (30d)
7

Description

How to reproduce

  1. Logged out and cleared localStorage
  2. Attempted to login to https://melvin.solid.live/public/RWWCrew/
  3. Click on custom domain, https://melvincarvalho.com/#me

Observed behaviour

Uncaught (in promise) TypeError: Cannot read property 'webId' of null
    at signin.js:732
    at <anonymous>

in

  signInPopUpButton.addEventListener('click', function () {
    var offline = offlineTestID();
    if (offline) return setUserCallback(offline.uri);
    return solidAuthClient.popupLogin({ popupUri: $SOLID_GLOBAL_config.popupUri }).then(function (session) {
      var webIdURI = session.webId;

Expected Behaviour

What I would expect is to redirect me to my oidc provider, let me log in, and then give me a bearer token

Possible fix

https://github.com/solid/solid-ui/blob/master/src/signin.js#L739 should use webIdFromSession

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/signin.js around the signInPopUpButton handler near line 739, then compare its session handling with webIdFromSession near line 783. Reproduce the logged-out custom-domain login flow and verify that a null session no longer causes the reported webId TypeError and that the expected provider login and bearer-token flow can proceed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.