Skip to content

Commit a885831

Browse files
committed
Add temporary placeholders for SoF authentication
1 parent ac47cae commit a885831

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/lib/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const SOF_HOSTS = [
1616
{
1717
id: "keycloak",
1818
name: "Let's Talk Tech Login",
19-
url: "https://keycloak.inform.dev.cirg.uw.edu/realms/ltt",
19+
url: "https://fhir.inform.dev.cirg.uw.edu/fhir",
2020
clientId: "shl_creator",
2121
note: "Credentials provided"
2222
}

src/lib/sofClient.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let client;
1717
function authorize(inputFhirUrl, clientId) {
1818
config.iss = inputFhirUrl;
1919
config.clientId = clientId ?? "no clientId configured";
20-
// TODO: Remove in favor of producing correct token response on server side
20+
// TODO SOF: Remove in favor of producing correct token response on server side
2121
let fakeTokenResponse = {
2222
authorizeUri: "https://keycloak.inform.dev.cirg.uw.edu/realms/ltt/protocol/openid-connect/auth",
2323
tokenUri: "https://keycloak.inform.dev.cirg.uw.edu/realms/ltt/protocol/openid-connect/token"
@@ -50,8 +50,9 @@ function getReferences(obj, references) {
5050
}
5151

5252
async function requestResources(client, resourceType) {
53+
// TODO SOF: Replace with appropriate query once server is configured
5354
// let endpoint = (resourceType == 'Patient' ? 'Patient/' : `${resourceType}?patient=`) + client.getPatientId();
54-
let endpoint = "https://fhir.inform.dev.cirg.uw.edu/fhir/Patient";
55+
let endpoint = "Patient";
5556
return client.request(endpoint, { flat: true }).then((result) => {
5657
let resourcesToPass = [];
5758
if (Array.isArray(result)) {
@@ -77,10 +78,11 @@ async function activePatient() {
7778
async function getResources() {
7879
client = await FHIR.oauth2.ready();
7980
let pid = client.getPatientId();
80-
if (!pid) {
81-
console.error("No patient ID found");
82-
return undefined;
83-
}
81+
// TODO SOF: Bring back in once SMART Auth is set up
82+
// if (!pid) {
83+
// console.error("No patient ID found");
84+
// return undefined;
85+
// }
8486
// Establish resource display methods
8587
let resources = (await Promise.allSettled(SOF_PATIENT_RESOURCES.map((resourceType) => {
8688
return requestResources(client, resourceType);

0 commit comments

Comments
 (0)