comunica / jQuery-Widget.js

🖼 A jQuery widget to query heterogeneous interfaces using Comunica SPARQL
http://query.linkeddatafragments.org/
MIT License
18 stars 35 forks source link

Solid authentication: can't logout if the url of the datasource "My Solid Profile" is already in the list of datasources #150

Closed mvanbrab closed 1 year ago

mvanbrab commented 1 year ago

When logging in, a new datasource named "My Solid Profile" is added to the list of datasources. However, if the url (in this case the WebId) is already in an existing datasource, an error occurs.

Querying works, but when trying to log out, the logout button doesn't work. This is harmful when demoing queries issued as different logged in users.

The error captured from a Firefox debugger console:

Uncaught (in promise) Error: Invalid datasource configuration: Each URL can only occur once in the datasource list, but found "https://css1/lindner-group/profile/card#me" in datasources "My Solid Profile" and "WebID Profile Document: Lindner Group"
    _setOption https://webclient/scripts/ldf-client-ui.min.js:2
    _setOption https://webclient/scripts/ldf-client-ui.min.js:2
    _setOption https://webclient/scripts/ldf-client-ui.min.js:2
ldf-client-ui.min.js:2:466321

A proposed solution: Check the presence of the WebId in the existing datasources and if found, do not add it again as a new datasource.

rubensworks commented 1 year ago

The proposed solution sounds good to me!