Skip to content

Commit

Permalink
Merge pull request #1 from uwcirg/feature/as-confidential-front-end
Browse files Browse the repository at this point in the history
Extend to behave as public or front-end for confidential backend
  • Loading branch information
pbugni authored Jul 11, 2022
2 parents 7e8ef15 + b190b4a commit 88790a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ export default function Launch() {
const [error, setError] = React.useState('');

React.useEffect(() => {

let authURL = 'launch-context.json';
if (process.env.REACT_APP_BACKEND_URL) {
authURL = `${process.env.REACT_APP_BACKEND_URL}/auth/auth-info`;
}
const urlParams = new URLSearchParams(window.location.search);
//retrieve patient id from URL querystring if any
let patientId = urlParams.get('patient');
console.log("patient id from url query string: ", patientId);
console.log("authURL: ", authURL);

fetch('launch-context.json', {
fetch(authURL, {
// include cookies in request
credentials: 'include'
})
Expand Down

0 comments on commit 88790a1

Please sign in to comment.