qalam_oauth_engine 3.0.5 → 3.0.6

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: 1993e64ae7d887fb6d5ca81b7d41b841a41f16f6713dfa5750c16131b64b7b04
4
- data.tar.gz: f8be0a0e38579e6a171cef590863fcca4ce7b7f06ed891c1824d12fdc07f3b61
3
+ metadata.gz: fedb8888333b8e5593967fd75d34041dabd73bd19af4cc017b77f3ee4125d6b9
4
+ data.tar.gz: 6bc18fbcb7d0cae6641da7418dad7835bf5890dcc28502b06a42e9737bb35c68
5
5
  SHA512:
6
- metadata.gz: 11c52e55a0c2f63ac009f6ef29d53601078e343959cc56ecfdc8506684aee1f70b18c65e9f3bc34328af8ddde91ba6facd2ca3277d2d5b2c525cf1ca4a92490b
7
- data.tar.gz: bc76c81bedb0aac378b675cd6d7b6f56dc1053f5af6f70ab9518e4a34928ffba4fb6559921444c730df2b89877b645e581bac91b841765a68eac27b29e72e6df
6
+ metadata.gz: 8cc4173cba1f1fefd30015c358b0e123ab34f329fad944559996a88c14f9d5ca0e36ce4077d7de064a80989c0c9bd7a2893fff621f9644e73168b3670dcb86a0
7
+ data.tar.gz: 16dd53a5746b3cb1d2166057874a77faeccb53a7fa154dec30cd1804be8db76443d8cf5139ad0f864aeb1f9b5d6a5ec0ebd746b4ed84d35c43ee08e9f808df0f
@@ -6,6 +6,7 @@ module CanvasOauth
6
6
  if verify_oauth2_state(params[:state]) && params[:code]
7
7
  if token = canvas.get_access_token(params[:code])
8
8
  set_root_account
9
+ puts @root_account_id.inspect.green
9
10
  refresh_token = canvas.refresh_token
10
11
  if CanvasOauth::Authorization.cache_token(token, refresh_token, user_id, @root_account_id, tool_consumer_instance_guid)
11
12
  redirect_to main_app.root_path
@@ -23,13 +24,13 @@ module CanvasOauth
23
24
  def verify_oauth2_state(callback_state)
24
25
  callback_state.present? && callback_state == session.delete(:oauth2_state)
25
26
  end
26
- end
27
27
 
28
- def set_root_account
29
- if current_account_id
30
- @root_account_id = canvas.root_account_id(current_account_id)
31
- elsif current_course_id
32
- @root_account_id = canvas.course_root_account_id(current_course_id)
28
+ def set_root_account
29
+ if session[:account_id]
30
+ @root_account_id = canvas.root_account_id(session[:account_id])
31
+ elsif session[:course_id]
32
+ @root_account_id = canvas.course_root_account_id(session[:course_id])
33
+ end
33
34
  end
34
35
  end
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module CanvasOauth
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qalam_oauth_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Donahue