atomic_lti 1.5.3 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ import { initOIDCLaunch } from '@atomicjolt/lti-client';
2
+ import type { InitSettings } from '@atomicjolt/lti-client/types';
3
+
4
+ declare global {
5
+ interface Window {
6
+ INIT_SETTINGS: InitSettings;
7
+ }
8
+ }
9
+
10
+ const initSettings: InitSettings = window.INIT_SETTINGS;
11
+ initOIDCLaunch(initSettings);
@@ -5,6 +5,9 @@
5
5
  .hidden { display: none !important; }
6
6
  </style>
7
7
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet">
8
+ <script type="text/javascript">
9
+ window.INIT_SETTINGS = <%= @settings.to_json.html_safe %>;
10
+ </script>
8
11
  <%= stylesheet_link_tag "atomic_lti/launch" %>
9
12
  <%= javascript_include_tag "atomic_lti/init_app" %>
10
13
  </head>
@@ -19,8 +22,5 @@
19
22
  </noscript>
20
23
  <div id="main-content">
21
24
  </div>
22
- <script type="text/javascript">
23
- InitOIDCLaunch(window.SETTINGS);
24
- </script>
25
25
  </body>
26
26
  </html>
@@ -169,14 +169,16 @@ module AtomicLti
169
169
  env["atomic.validated.id_token"] = id_token
170
170
 
171
171
  platform = AtomicLti::Platform.find_by!(iss: id_token_decoded["iss"])
172
- if request.params["lti_storage_target"].present? && AtomicLti.use_post_message_storage
173
- lti_storage_params = build_lti_storage_params(request, platform)
174
- # Add the values needed to do client side validate to the environment
175
- env["atomic.validated.state_validation"] = {
176
- state: state,
177
- lti_storage_params: lti_storage_params,
178
- state_verified: state_verified,
179
- }
172
+
173
+ # Add the values needed to do client side validate to the environment
174
+ env["atomic.validated.state_validation"] = {
175
+ state: state,
176
+ state_verified: state_verified,
177
+ }
178
+
179
+ if !state_verified && request.params["lti_storage_target"].present? && AtomicLti.use_post_message_storage
180
+ env["atomic.validated.state_validation"][:lti_storage_params] =
181
+ build_lti_storage_params(request, platform)
180
182
  end
181
183
 
182
184
  @app.call(env)
@@ -1,3 +1,3 @@
1
1
  module AtomicLti
2
- VERSION = "1.5.3".freeze
2
+ VERSION = "1.5.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomic_lti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Petro
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-18 00:00:00.000000000 Z
13
+ date: 2023-10-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pg
@@ -61,7 +61,7 @@ files:
61
61
  - app/assets/stylesheets/atomic_lti/launch.css
62
62
  - app/controllers/atomic_lti/jwks_controller.rb
63
63
  - app/helpers/atomic_lti/launch_helper.rb
64
- - app/javascript/atomic_lti/init_app.js
64
+ - app/javascript/atomic_lti/init_app.ts
65
65
  - app/jobs/atomic_lti/application_job.rb
66
66
  - app/lib/atomic_lti/auth_token.rb
67
67
  - app/lib/atomic_lti/authorization.rb
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.4.15
135
+ rubygems_version: 3.4.19
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: AtomicLti implements the LTI Advantage specification.
@@ -1,3 +0,0 @@
1
- import { InitOIDCLaunch } from '@atomicjolt/lti-client/src/init';
2
-
3
- InitOIDCLaunch(window.SETTINGS);