omniauth-campus 0.4.6 → 0.4.7

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: d61b4d1bcc51de8749c20cecdc0bd617eb527ae9
4
- data.tar.gz: de1664a6603236f29b5220ef4af39ca266807bab
3
+ metadata.gz: b4c84cc14ebb7fb660df1301b3f96fbc9a37cee3
4
+ data.tar.gz: a34294796a1ab70357c43525653bff7c7a854e55
5
5
  SHA512:
6
- metadata.gz: 83c7b5f71e720833372a7f20ebd3bd3f7c84a4f4a0e5819b9bbd42972abb38cc23148ee863050f224d1e7f9099819aabb502ea052a5022171690211d57f370de
7
- data.tar.gz: 9e790a4095aa4e48c3754b525e6d0393c048be46d7a7e00e68b831ae59ecd51cd948b6ca205fd54b16205735b4fc6a988303f42133f6f54eb53b740287823c38
6
+ metadata.gz: 4c949d2eb0e7922d266d6a9b5e12eb0f42844d65bf7e5aea0f842f80f2787ad5406dd459fa2cb531b51a8ca48e82307aa3c931233c70d4edcb84376165785b3f
7
+ data.tar.gz: 61d34927f0cb6108f4dbfd76130f0746aff2b4b15198b566dd4b2b6cdabe52cc4af56d5a3e894a70709ad740706f44677e173a6c81bd4edcfef1c05c7513348e
Binary file
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "0.4.6"
3
+ VERSION = "0.4.7"
4
4
  end
5
5
  end
6
6
 
Binary file
@@ -30,16 +30,6 @@ module OmniAuth
30
30
 
31
31
  option :fields, [:name, :email]
32
32
 
33
- option :auth_token_params, {
34
- param_name: 'access_token',
35
- mode: :query
36
- }
37
-
38
-
39
-
40
- attr_accessor :access_token
41
-
42
-
43
33
 
44
34
  #site' 'http://community3dev.devcloud.acquia-sites.com/api'
45
35
 
@@ -50,10 +40,27 @@ module OmniAuth
50
40
  #
51
41
  # }
52
42
  #
53
- #
54
-
43
+ def request_method
44
+ if env['REQUEST_METHOD'] == 'GET'
45
+ get_credentials
46
+ end
47
+ end
55
48
 
49
+ def get_credentials
50
+ form = OmniAuth::Form.new(:title => "User Info")
51
+ options.fields.each do |field|
52
+ form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
53
+ end
54
+ form.button "Sign In"
55
+ form.to_response
56
+ end
56
57
 
58
+ def consumer
59
+ consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
60
+ consumer.http.open_timeout = options.open_timeout if options.open_timeout
61
+ consumer.http.read_timeout = options.read_timeout if options.read_timeout
62
+ consumer
63
+ end
57
64
 
58
65
  uid {raw_info['uid']}
59
66
 
@@ -64,7 +71,7 @@ module OmniAuth
64
71
  end
65
72
 
66
73
  def raw_info
67
- @raw_info ||= MultiJson.decode( access_token.get('/users/me').body )["users"].first
74
+ @raw_info ||= MultiJson.decode(access_token.get('/me').body )
68
75
  end
69
76
 
70
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-campus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr