Skip to content

Commit 26fba67

Browse files
oatymartwazelin
andauthored
Fix/additive custom claims arrays (#170)
* feat: add preset claims while keeping existing claim contents * feat: add more custom claims * chore: update CHANGELOG * Update CHANGELOG.md Co-authored-by: Sergei Mikhailov <[email protected]> Signed-off-by: Martin Nicholson <[email protected]> * chore: update application_version * fix: set claim JSON correctly for non-objects * chore: version bump and CHANGELOG update --------- Signed-off-by: Martin Nicholson <[email protected]> Co-authored-by: Sergei Mikhailov <[email protected]>
1 parent fe6eb88 commit 26fba67

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
2.11.1
5+
------
6+
7+
* Fixed claim selection for simple arrays
8+
49
2.11.0
510
------
611

@@ -118,7 +123,7 @@ Fixed handling of concurrent AGS requests
118123
-----
119124

120125
* Updated LTI 1.3 bundle and libraries dependencies
121-
* Updated Symfony packages to version 5.3.x
126+
* Updated Symfony packages to version 5.3.x
122127
* Updated devkit registration to be the default one
123128

124129
2.0.1

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88
application_env: '%env(resolve:APP_ENV)%'
99
application_api_key: '%env(resolve:APP_API_KEY)%'
1010
application_vendors: '%kernel.project_dir%/vendor/composer/installed.php'
11-
application_version: '2.11.0'
11+
application_version: '2.11.1'
1212
container.dumper.inline_factories: true
1313
cache.redis.namespace: '%env(default:cache.redis.namespace.default:REDIS_CACHE_NAMESPACE)%'
1414
cache.redis.namespace.default: 'devkit'

templates/platform/message/ltiResourceLinkLaunch.html.twig

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,17 @@
225225
$(".editorClaim").click(function(event){
226226
try {
227227
var claims = JSON.parse($("#lti_resource_link_launch_claims").val() || "{}");
228-
claims[$(this).data('name')] = {
229-
...$(this).data('value'),
230-
...claims[$(this).data('name')]
231-
};
228+
var name = $(this).data('name');
229+
var value = $(this).data('value');
230+
231+
if (typeof value === 'object' && !Array.isArray(value)) {
232+
claims[name] = {
233+
...value,
234+
...claims[name]
235+
};
236+
} else {
237+
claims[name] = value;
238+
}
232239
$("#lti_resource_link_launch_claims").val(JSON.stringify(claims, undefined, 4));
233240
$("#lti_resource_link_launch_claims").removeClass('is-invalid');
234241
$("#lti_resource_link_launch_claims").addClass('is-valid');

0 commit comments

Comments
 (0)