Skip to content

Commit 88790a1

Browse files
authored
Merge pull request #1 from uwcirg/feature/as-confidential-front-end
Extend to behave as public or front-end for confidential backend
2 parents 7e8ef15 + b190b4a commit 88790a1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/Launch.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ export default function Launch() {
1111
const [error, setError] = React.useState('');
1212

1313
React.useEffect(() => {
14-
14+
let authURL = 'launch-context.json';
15+
if (process.env.REACT_APP_BACKEND_URL) {
16+
authURL = `${process.env.REACT_APP_BACKEND_URL}/auth/auth-info`;
17+
}
1518
const urlParams = new URLSearchParams(window.location.search);
1619
//retrieve patient id from URL querystring if any
1720
let patientId = urlParams.get('patient');
1821
console.log("patient id from url query string: ", patientId);
22+
console.log("authURL: ", authURL);
1923

20-
fetch('launch-context.json', {
24+
fetch(authURL, {
2125
// include cookies in request
2226
credentials: 'include'
2327
})

0 commit comments

Comments
 (0)