omniauth-canvas 0.1.3 → 1.0.0

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
  SHA1:
3
- metadata.gz: b7d90232035d82f77899c0ebc88dc52ccc2d72f5
4
- data.tar.gz: 1aede78f76663a8c5909129c5ab129e847348bb4
3
+ metadata.gz: 4c0c30e36d3e9b1c579d216e667b02ad46187a61
4
+ data.tar.gz: 5b6138bd38ebb022175315f85f5f9a5ad89d73ee
5
5
  SHA512:
6
- metadata.gz: eccc01db48cd4cb81299b45c944d7914f4868138813556e9929e94e84bfad6eababef8dadf83cb0071ef6e5c5cb345dff68b67a2df58ca0540dd5cf8a2eeef18
7
- data.tar.gz: 2bd428be2dbd5b4d262d76da4e6412615f0ad6ae539bc6e8d19ba54d10de90b4d6d52037f9c1a2a68ec50eb912338b029292ba8df3dc4807b5a86c149bcf5c44
6
+ metadata.gz: 64f34e7d984274d65b291797ac430354c84a21e68112cf7a599efb0b8b1653dfab73f86a95641c7ae4e9c8e81e22efee15c8391accffb63c4819498c6c669fc4
7
+ data.tar.gz: 1fb3d8d74b34dc7053bb957bade9d1559971674261e8a6222643593e30275ac5f5841a39e8aa3af8c1f2c17f6dd332b142b61067cb8607765d13344df771592e
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Canvas
3
- VERSION = "0.1.3".freeze
3
+ VERSION = "1.0.0".freeze
4
4
  end
5
5
  end
@@ -39,9 +39,25 @@ module OmniAuth
39
39
  @raw_info ||= access_token.get("/api/v1/users/#{access_token['user']['id']}/profile").parsed
40
40
  end
41
41
 
42
+ # Passing any query string value to Canvas will result in:
43
+ # redirect_uri does not match client settings
44
+ # so we set the value to empty string
42
45
  def query_string
43
46
  ""
44
47
  end
48
+
49
+ # Override authorize_params so that we can be deliberate about setting state if needed
50
+ def authorize_params
51
+ # Only set state if it hasn't already been set
52
+ options.authorize_params[:state] ||= SecureRandom.hex(24)
53
+ params = options.authorize_params.merge(options_for("authorize"))
54
+ if OmniAuth.config.test_mode
55
+ @env ||= {}
56
+ @env["rack.session"] ||= {}
57
+ end
58
+ session["omniauth.state"] = params[:state]
59
+ params
60
+ end
45
61
  end
46
62
  end
47
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-05 00:00:00.000000000 Z
11
+ date: 2017-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth