omniauth-google-oauth2 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3@omniauth-google-oauth2 --create
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
data/README.md CHANGED
@@ -147,6 +147,10 @@ end
147
147
  ```
148
148
  Detailed example at https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview#google-oauth2-example
149
149
 
150
+ ## Build Status
151
+ [![Build Status](https://travis-ci.org/zquestz/omniauth-google-oauth2.png)](https://travis-ci.org/zquestz/omniauth-google-oauth2)
152
+
153
+
150
154
  ## License
151
155
 
152
156
  Copyright (c) 2013 by Josh Ellithorpe
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GoogleOauth2
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ module OmniAuth
8
8
 
9
9
  option :name, 'google_oauth2'
10
10
 
11
- option :authorize_options, [:access_type, :hd, :login_hint, :prompt, :scope, :state]
11
+ option :authorize_options, [:access_type, :hd, :login_hint, :prompt, :scope, :state, :redirect_uri]
12
12
 
13
13
  option :client_options, {
14
14
  :site => 'https://accounts.google.com',
@@ -26,7 +26,6 @@ module OmniAuth
26
26
  scope_list = raw_scope.split(" ").map {|item| item.split(",")}.flatten
27
27
  scope_list.map! { |s| s =~ /^https?:\/\// ? s : "#{BASE_SCOPE_URL}#{s}" }
28
28
  params[:scope] = scope_list.join(" ")
29
-
30
29
  params[:access_type] = 'offline' if params[:access_type].nil?
31
30
 
32
31
  session['omniauth.state'] = params[:state] if params['state']
@@ -64,6 +64,18 @@ describe OmniAuth::Strategies::GoogleOauth2 do
64
64
  end
65
65
  end
66
66
 
67
+ describe "redirect_uri" do
68
+ it 'should default to nil' do
69
+ @options = {}
70
+ subject.authorize_params['redirect_uri'].should eq(nil)
71
+ end
72
+
73
+ it 'should set the redirect_uri parameter if present' do
74
+ @options = {:redirect_uri => 'https://example.com'}
75
+ subject.authorize_params['redirect_uri'].should eq('https://example.com')
76
+ end
77
+ end
78
+
67
79
  describe 'access_type' do
68
80
  it 'should default to "offline"' do
69
81
  @options = {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-google-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-26 00:00:00.000000000 Z
13
+ date: 2013-08-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: omniauth
@@ -85,6 +85,8 @@ extra_rdoc_files: []
85
85
  files:
86
86
  - .gitignore
87
87
  - .ruby-version
88
+ - .rvmrc
89
+ - .travis.yml
88
90
  - Gemfile
89
91
  - README.md
90
92
  - Rakefile
@@ -111,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
113
  version: '0'
112
114
  segments:
113
115
  - 0
114
- hash: 3419223679075282688
116
+ hash: -775688096927888860
115
117
  required_rubygems_version: !ruby/object:Gem::Requirement
116
118
  none: false
117
119
  requirements:
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  version: '0'
121
123
  segments:
122
124
  - 0
123
- hash: 3419223679075282688
125
+ hash: -775688096927888860
124
126
  requirements: []
125
127
  rubyforge_project:
126
128
  rubygems_version: 1.8.25