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 +4 -4
- data/app/controllers/canvas_oauth/canvas_controller.rb +7 -6
- data/lib/canvas_oauth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fedb8888333b8e5593967fd75d34041dabd73bd19af4cc017b77f3ee4125d6b9
|
4
|
+
data.tar.gz: 6bc18fbcb7d0cae6641da7418dad7835bf5890dcc28502b06a42e9737bb35c68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
data/lib/canvas_oauth/version.rb
CHANGED