omniauth-campus 1.3 → 1.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
  SHA1:
3
- metadata.gz: 284181887d94a216f467dbe617e1f3cf4738d029
4
- data.tar.gz: f41ea8f962036ab321fb7d2f902340bff1e409e0
3
+ metadata.gz: 3c16d37434b9fe9e988bc915ecdcf8937926026c
4
+ data.tar.gz: 2f33553fcad05d329a81d6fd82adb156ffb479c6
5
5
  SHA512:
6
- metadata.gz: 52a21f58e5c700ff58e2f86c56b2368863e948026e79537541a74770b79ccdb45334cab3f8b873cae26901a6add691cbb6b4a2509aff666cf3e720f6373b0d1c
7
- data.tar.gz: db670b804c70f1e03030261052a6195f8ea9d90fe239e7df5bd7e97f21f0172d85a1196c9e4da216960969783bd4f8962e322d264cf9d064ca33f48cd1aea290
6
+ metadata.gz: 93902abf2bf2375ed66de1e79d6d9b050cea1b11232f6d18d0d056b7c557cc4d4a4a99c38a51a8e0f58f352339c6541fc75ebd0e8c0562899ec7ae8603da062c
7
+ data.tar.gz: 67a15df8815a6e56cad25f7ce6d122383cfebc072130e25e703e30b1c5d288892b52bc48c980c035dc8e471d1ef0bed5de21485a8f75d327d3bd8133f40f61fb
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "1.3"
3
+ VERSION = "1.4"
4
4
  end
5
5
  end
6
6
 
@@ -22,11 +22,31 @@ module OmniAuth
22
22
  #:site => 'http://dev-oauth-test.gotpantheon.com/myawesomejson',
23
23
  #:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
24
24
 
25
+ def consumer
26
+ consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
27
+ consumer.http.open_timeout = options.open_timeout if options.open_timeout
28
+ consumer.http.read_timeout = options.read_timeout if options.read_timeout
29
+ consumer
30
+ end
31
+
25
32
  def request_phase
26
- options[:authorize_params] = {:perms => options[:scope]} if options[:scope]
27
- super
33
+ request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
34
+ session['oauth'] ||= {}
35
+ session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
36
+
37
+ if request_token.callback_confirmed?
38
+ redirect request_token.authorize_url(options[:authorize_params])
39
+ else
40
+ redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_callback => callback_url))
41
+ end
42
+
43
+ rescue ::Timeout::Error => e
44
+ fail!(:timeout, e)
45
+ rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
46
+ fail!(:service_unavailable, e)
28
47
  end
29
48
 
49
+
30
50
  uid{ request.params['user_id'] }
31
51
 
32
52
  info do
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: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr