Skip to content

Commit

Permalink
Don't throw error if permissions cannot be fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
srosset81 committed Jan 30, 2023
1 parent 397c8ef commit 54500de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/frontend/packages/auth-provider/dist/index.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/frontend/packages/auth-provider/dist/index.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/frontend/packages/auth-provider/dist/index.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/frontend/packages/auth-provider/dist/index.es.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/frontend/packages/auth-provider/src/authProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ const authProvider = ({

const aclUri = getAclUri(uri);

const { json } = await dataProvider.fetch(aclUri);

return json['@graph'];
try {
const { json } = await dataProvider.fetch(aclUri);
return json['@graph'];
} catch(e) {
console.warn(`Could not fetch ACL URI ${uri}`);
return [];
}
},
addPermission: async (uri, agentId, predicate, mode) => {
if (!uri || !uri.startsWith('http')) throw new Error('The first parameter passed to addPermission must be an URL');
Expand Down

0 comments on commit 54500de

Please sign in to comment.