Skip to content

Commit dd19006

Browse files
committed
need to remove code_challenge
1 parent 082c8d9 commit dd19006

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ production.env
2929
sandbox.env
3030

3131
config.ts
32-
.bluebutton-config.json
32+
.bluebutton-config.json
33+
# Snyk Security Extension - AI Rules (auto-generated)
34+
.github/instructions/snyk_rules.instructions.md

server/index.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ app.get("/api/authorize/authurl", (req: Request, res: Response) => {
4545
// for SMART App v2 scopes usage: explicitly
4646
// provide query parameter scope=<v2 scopes>
4747
// where <v2 scopes> is space delimited v2 scope specs (url encoded)
48-
// e.g. patient/ExplanationOfBenefit.rs
48+
// e.g. patient/ExplanationOfBenefit.read
49+
console.log("bb.version:", bb.version);
4950
const redirectUrl = bb.generateAuthorizeUrl(authData) +
50-
"&scope=patient%2FExplanationOfBenefit.rs"
51+
"&scope=patient%2FExplanationOfBenefit.read"
52+
console.log("redirectUrl:", redirectUrl);
5153
res.send(redirectUrl);
5254
});
5355

@@ -75,20 +77,29 @@ app.get("/api/bluebutton/callback", (req: Request, res: Response) => {
7577
req.query.code,
7678
req.query.state
7779
);
80+
console.log("Auth Token Scope:", authToken.scope);
7881
// data flow: after access granted
7982
// the app logic can fetch the beneficiary's data in app specific ways:
8083
// e.g. download EOB periodically etc.
8184
// access token can expire, SDK automatically refresh access token when that happens.
8285
const eobResults = await bb.getExplanationOfBenefitData(authToken);
86+
process.stdout.write("EOB Results: " + JSON.stringify(eobResults) + '\n');
87+
console.log("EOB Results: ", eobResults);
8388
authToken = eobResults.token; // in case authToken got refreshed during fhir call
84-
89+
process.stdout.write("Refreshed Auth Token: " + JSON.stringify(authToken) + '\n');
90+
console.log("Refreshed Auth Token: ", authToken);
91+
8592
loggedInUser.authToken = authToken;
8693

8794
loggedInUser.eobData = eobResults.response?.data;
88-
} catch (e) {
95+
} catch (e: any) {
8996
loggedInUser.eobData = {};
9097
process.stdout.write(ERR_QUERY_EOB + '\n');
9198
process.stderr.write("Exception: " + String(e) + '\n');
99+
if (e.response) {
100+
console.log("Error status:", e.response.status);
101+
console.log("Error data:", e.response.data);
102+
}
92103
}
93104
} else {
94105
clearBB2Data();

0 commit comments

Comments
 (0)