Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions apps/curation-dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/curation-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.1",
"axios": "^0.21.1",
"keycloak-js": "^8.0.1",
"keycloak-js": "^12.0.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.3"
Expand Down
2 changes: 1 addition & 1 deletion apps/curation-dashboard/src/ModelTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default function ModelTable(props) {
setErrorMessage('Error loading models: ', err.message);
setLoading(false);
});
}, []);
}, [props.auth]);

const handleRequestSort = (event, property, type) => {
const isAsc = orderBy === property && order === 'asc';
Expand Down
9 changes: 4 additions & 5 deletions apps/curation-dashboard/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import Keycloak from 'keycloak-js';
const keycloak = Keycloak({
url: 'https://iam.ebrains.eu/auth',
realm: 'hbp',
clientId: 'model-catalog'
clientId: 'model-catalog',
'public-client': true,
'confidential-port': 0,
});
const YOUR_APP_SCOPES = 'team email profile'; // full list at https://iam.ebrains.eu/auth/realms/hbp/.well-known/openid-configuration


export default function initAuth(main) {
console.log('DOM content is loaded, initialising Keycloak client...');
keycloak
.init({ flow: 'implicit', promiseType: 'native' })
.init({ flow: 'standard', pkceMethod: 'S256' })
.then(() => checkAuth(main))
.catch(console.log);
}


function checkPermissions(keycloak) {
return keycloak.loadUserInfo()
.then((userInfo) => {

if (userInfo.roles.team.includes("collab-model-validation-editor") || userInfo.roles.team.includes("collab-model-validation-administrator")) {
keycloak.authorized = true;
} else {
Expand All @@ -32,7 +32,6 @@ function checkPermissions(keycloak) {
})
}


function checkAuth(main) {
console.log('Keycloak client is initialised, verifying authentication...');

Expand Down
1 change: 0 additions & 1 deletion apps/curation-dashboard/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
import initAuth from './auth';
import App from './App';


function renderApp(auth) {
ReactDOM.render(
<React.StrictMode>
Expand Down
Loading