File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "oidcUrl" : " https://login.aai.lifescience-ri.eu/oidc/" ,
3
+ "oidcClientId" : " d3132b30-3a07-4a66-a065-512674fac86e"
4
+ }
Original file line number Diff line number Diff line change @@ -4,4 +4,12 @@ export async function loadConfig() {
4
4
throw new Error ( "Can not load config.json: " + res . status ) ;
5
5
}
6
6
return res . json ( ) ;
7
+ }
8
+
9
+ export async function loadOIDCConfig ( ) {
10
+ const res = await fetch ( "/config/config-oidc.json" , { cache : "no-store" } ) ;
11
+ if ( ! res . ok ) {
12
+ throw new Error ( "Can not load config.json: " + res . status ) ;
13
+ }
14
+ return res . json ( ) ;
7
15
}
Original file line number Diff line number Diff line change 1
1
import { createRoot } from "react-dom/client" ;
2
2
import App from "./App" ;
3
3
import "./index.css" ;
4
- import { loadConfig } from "./configLoader" ;
4
+ import { loadConfig , loadOIDCConfig } from "./configLoader" ;
5
5
import { AuthProvider } from "react-oidc-context" ;
6
6
7
7
( async ( ) => {
8
8
const root = createRoot ( document . getElementById ( 'root' ) ) ;
9
9
try {
10
10
const cfg = await loadConfig ( ) ;
11
+ const OIDCCfg = await loadOIDCConfig ( ) ;
11
12
12
13
window . CONFIG = cfg ;
13
14
globalThis . CONFIG = cfg ;
14
15
15
16
console . log ( process . env )
16
17
17
18
const oidcConfig = {
18
- authority : `${ process . env . REACT_APP_BEACON_UI_OIDC_ENDPOINT } ` ,
19
- client_id : `${ process . env . REACT_APP_BEACON_UI_OIDC_CLIENT_ID } ` ,
19
+ authority : `${ OIDCCfg . oidcUrl } ` ,
20
+ client_id : `${ OIDCCfg . oidcClientId } ` ,
20
21
redirect_uri : `https://beacons.bsc.es/` ,
21
22
post_logout_redirect_uri : `https://beacons.bsc.es/` ,
22
23
response_type : "code" ,
You can’t perform that action at this time.
0 commit comments