Skip to content

Commit

Permalink
(Release): 5.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvmcosta committed Apr 4, 2023
1 parent 85a42af commit 6a7bcc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/Provider/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ class Provider {
};
const hashOfAdditionalContextProperties = crypto.createHash('sha256').update(JSON.stringify(additionalContextProperties)).digest('hex');

// Appending hashOfContextProperties is a temporary fix to prevent overwriting existing database entries in some scenarios. See: https://github.com/Cvmcosta/ltijs/issues/181
const contextId = encodeURIComponent(valid.iss + clientId + deploymentId + courseId + '_' + resourceId + "_" + hashOfAdditionalContextProperties);
// Appending hashOfContextProperties is a temporary fix to prevent overwriting existing database entries in some scenarios. See: https://github.com/Cvmcosta/ltijs/issues/181
const contextId = encodeURIComponent(valid.iss + clientId + deploymentId + courseId + '_' + resourceId + '_' + hashOfAdditionalContextProperties);
const platformCode = encodeURIComponent('lti' + Buffer.from(valid.iss + clientId + deploymentId).toString('base64'));

// Mount platform token
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ltijs",
"version": "5.9.1",
"version": "5.9.2",
"description": "Easily turn your web application into a LTI 1.3 Learning Tool.",
"main": "index.js",
"engineStrict": true,
Expand Down
10 changes: 5 additions & 5 deletions src/Provider/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,21 @@ class Provider {

const clientId = valid.clientId
const deploymentId = valid['https://purl.imsglobal.org/spec/lti/claim/deployment_id']

const additionalContextProperties = {
path: req.path,
roles: valid['https://purl.imsglobal.org/spec/lti/claim/roles'],
targetLinkUri: valid['https://purl.imsglobal.org/spec/lti/claim/target_link_uri'],
custom: valid['https://purl.imsglobal.org/spec/lti/claim/custom'],
launchPresentation: valid['https://purl.imsglobal.org/spec/lti/claim/launch_presentation'],
endpoint: valid['https://purl.imsglobal.org/spec/lti-ags/claim/endpoint'],
namesRoles: valid['https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice'],
namesRoles: valid['https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice']
}

const hashOfAdditionalContextProperties = crypto.createHash('sha256').update(JSON.stringify(additionalContextProperties)).digest('hex')
// Appending hashOfContextProperties is a temporary fix to prevent overwriting existing database entries in some scenarios. See: https://github.com/Cvmcosta/ltijs/issues/181
const contextId = encodeURIComponent(valid.iss + clientId + deploymentId + courseId + '_' + resourceId + "_" + hashOfAdditionalContextProperties)

// Appending hashOfContextProperties is a temporary fix to prevent overwriting existing database entries in some scenarios. See: https://github.com/Cvmcosta/ltijs/issues/181
const contextId = encodeURIComponent(valid.iss + clientId + deploymentId + courseId + '_' + resourceId + '_' + hashOfAdditionalContextProperties)

const platformCode = encodeURIComponent('lti' + Buffer.from(valid.iss + clientId + deploymentId).toString('base64'))

Expand Down

0 comments on commit 6a7bcc6

Please sign in to comment.