omniauth-google-oauth2 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # OmniAuth Google Oauth2 Strategy
1
+ # OmniAuth Google OAuth2 Strategy
2
2
 
3
- Strategy to auth with Google via Oauth2 in OmniAuth.
3
+ Strategy to auth with Google via OAuth2 in OmniAuth.
4
4
 
5
5
  ## License
6
6
 
data/examples/config.ru CHANGED
@@ -30,7 +30,7 @@ class App < Sinatra::Base
30
30
  end
31
31
  end
32
32
 
33
- use Rack::Session::Cookie
33
+ use Rack::Session::Cookie, :secret => ENV['RACK_COOKIE_SECRET']
34
34
 
35
35
  use OmniAuth::Builder do
36
36
  provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], {
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GoogleOauth2
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ module OmniAuth
19
19
  def setup_authorize_params
20
20
  opts = {
21
21
  :client_id => options[:client_id],
22
- :redirect_uri => callback_url,
22
+ :redirect_uri => options[:redirect_uri] || callback_url,
23
23
  :response_type => "code",
24
24
  :scope => options[:scope]
25
25
  }
@@ -22,6 +22,23 @@ describe OmniAuth::Strategies::GoogleOauth2 do
22
22
  end
23
23
  end
24
24
 
25
+ describe 'redirect_uri' do
26
+ before do
27
+ subject.stub(:callback_url).and_return('http://example.host/default')
28
+ end
29
+
30
+ it 'should be callback_url by default' do
31
+ subject.request_phase
32
+ subject.options[:authorize_params][:redirect_uri].should eql('http://example.host/default')
33
+ end
34
+
35
+ it 'should be overriden by an option' do
36
+ subject.options[:redirect_uri] = 'http://example.host/override'
37
+ subject.request_phase
38
+ subject.options[:authorize_params][:redirect_uri].should eql('http://example.host/override')
39
+ end
40
+ end
41
+
25
42
  describe '#callback_path' do
26
43
  it "has the correct callback path" do
27
44
  subject.callback_path.should eq('/auth/google_oauth2/callback')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-google-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josh Ellithorpe
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-03 00:00:00 -07:00
18
+ date: 2011-11-22 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency