panda_pal 5.2.3 → 5.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f45c2c850cfd4b5551aab3608bc23a315c220c4e29f808e7cfc7889858b3b0cf
4
- data.tar.gz: 4b53ce7fb3a47bcda9f9720696efd76d0c92c66cecd9abb3f8b03e318968187c
3
+ metadata.gz: 1172960b6e10f42eb328a83126a990d94d897e5b53587ad2a9fbcf2ddbcef46e
4
+ data.tar.gz: 3ca6cc0d6f3e621741bf3891d858b6f8917618d31270f83aca8b0dcdd6c0ffa8
5
5
  SHA512:
6
- metadata.gz: 7139f7d41bd4dbef2d955db4986aeb19a5ae19794a1677efb30621d9c3e6326e675b7128e46d6d609131c8c31861a3bb2cdce1ee7fca0282ed66c1a5a00b0dd3
7
- data.tar.gz: 53df5ac963b3b52bbe02f3fe296a79fa57fb73460cafd3a5261ca7092bdc80f5bce95011522c71cef41dd0635398878f4562450b8010db1e3011a9742c1c76d0
6
+ metadata.gz: 746e87df1af33d9391a8b7ea2d90e244c720d86100dd033a68e2b5e21a6a3d0ac057d58c44acd178e5585751d1f6e11ff006df5da10ebb910eec7712e57e1cdb
7
+ data.tar.gz: b20a4ac6fc5b389c8dfd6df682d7c3c67c8fec4551bfc0fb2ada48dd2f2ac8a0806673a5a9e926bf9af961291a476978fb7bee4da32cc0f8915313c033ebd73f
@@ -3,7 +3,7 @@ require 'browser'
3
3
  module PandaPal::Helpers::ControllerHelper
4
4
  extend ActiveSupport::Concern
5
5
 
6
- class SessionNotFound < StandardError; end
6
+ class SessionNonceMismatch < StandardError; end
7
7
 
8
8
  included do
9
9
  helper_method :link_nonce, :current_session
@@ -26,13 +26,12 @@ module PandaPal::Helpers::ControllerHelper
26
26
  @current_session = matched_session
27
27
  @current_session.data[:link_nonce] = nil
28
28
  end
29
+ raise SessionNonceMismatch, "Session Not Found" unless @current_session.present?
29
30
  elsif (session_key = params[:session_key] || session_key_header || flash[:session_key] || session[:session_key]).present?
30
31
  @current_session = PandaPal::Session.find_by(session_key: session_key) if session_key.present?
31
- else
32
- @current_session = PandaPal::Session.new(panda_pal_organization_id: current_organization.id)
33
32
  end
34
33
 
35
- raise SessionNotFound, "Session Not Found" unless @current_session.present?
34
+ @current_session ||= PandaPal::Session.new(panda_pal_organization_id: current_organization.id)
36
35
 
37
36
  @current_session
38
37
  end
@@ -154,6 +153,8 @@ module PandaPal::Helpers::ControllerHelper
154
153
  current_session.panda_pal_organization_id == current_organization.id,
155
154
  Apartment::Tenant.current == current_organization.name
156
155
  ].all?
156
+ rescue SessionNonceMismatch
157
+ false
157
158
  end
158
159
 
159
160
  def safari_override
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.2.3"
2
+ VERSION = "5.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.3
4
+ version: 5.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-19 00:00:00.000000000 Z
11
+ date: 2020-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails