solid-contrib / solid-auth-fetcher

A client library for authenticating with Solid
Other
2 stars 7 forks source link

getSessions() is missing #19

Open WhyINeedToFillUsername opened 3 years ago

WhyINeedToFillUsername commented 3 years ago

Describe the bug According to the readme at https://github.com/solid/solid-auth-fetcher/blob/master/README.md#logging-in-multiple-users, there should be getSessions() method. However, after using the library from npm, there is no exported member, nor implementation of the getSessions() method.

To Reproduce Steps to reproduce the behavior:

  1. npm install solid-auth-fetcher
  2. import { getSessions } from 'solid-auth-fetcher'
  3. no exported member getSessions

Expected behavior getSessions implemented as promoted :)

Additional context latest build - 1.3.5

josephguillaume commented 3 years ago

The core functionality for multiple users in this example is uniqueLogin, which itself is just a wrapper around loginHelper that doesn't specify a localUserId. getSessions is just used to check if the webid is already logged in (but looks like there's a typo in the example anyway). If I understand correctly, storage is always by localUserId, so there is currently no storage that getSessions could iterate through sessions created by uniqueLogin. Unless I've misunderstood something, I therefore suggest simply deleting this part of the README.md.

This issue could be left open as a getSessions function could still be written that iterates through data stored for different localUserIds, but it wouldn't be used with uniqueLogin specifically. A localUserId could also also be generated when missing, perhaps in setForUser, but this requires more thought.