devise 1.4.8 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
data/CHANGELOG.rdoc
CHANGED
data/lib/devise.rb
CHANGED
@@ -382,10 +382,13 @@ module Devise
|
|
382
382
|
|
383
383
|
# Include helpers in the given scope to AC and AV.
|
384
384
|
def self.include_helpers(scope)
|
385
|
-
Rails.application.routes.url_helpers.send :include, scope::UrlHelpers
|
386
|
-
|
387
385
|
ActiveSupport.on_load(:action_controller) do
|
388
386
|
include scope::Helpers if defined?(scope::Helpers)
|
387
|
+
include scope::UrlHelpers
|
388
|
+
end
|
389
|
+
|
390
|
+
ActiveSupport.on_load(:action_view) do
|
391
|
+
include scope::UrlHelpers
|
389
392
|
end
|
390
393
|
end
|
391
394
|
|
@@ -3,10 +3,9 @@ module Devise
|
|
3
3
|
module UrlHelpers
|
4
4
|
def self.define_helpers(mapping)
|
5
5
|
return unless mapping.omniauthable?
|
6
|
-
method = "#{mapping.name}_omniauth_authorize_path"
|
7
6
|
|
8
7
|
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
|
9
|
-
def #{
|
8
|
+
def #{mapping.name}_omniauth_authorize_path(provider, params = {})
|
10
9
|
if Devise.omniauth_configs[provider.to_sym]
|
11
10
|
script_name = request.env["SCRIPT_NAME"]
|
12
11
|
|
@@ -17,12 +16,9 @@ module Devise
|
|
17
16
|
raise ArgumentError, "Could not find omniauth provider \#{provider.inspect}"
|
18
17
|
end
|
19
18
|
end
|
20
|
-
protected :#{method}
|
21
19
|
URL_HELPERS
|
22
20
|
end
|
23
21
|
|
24
|
-
protected
|
25
|
-
|
26
22
|
def omniauth_authorize_path(resource_or_scope, *args)
|
27
23
|
scope = Devise::Mapping.find_scope!(resource_or_scope)
|
28
24
|
send("#{scope}_omniauth_authorize_path", *args)
|
data/lib/devise/version.rb
CHANGED
@@ -35,7 +35,7 @@ class HelpersTest < ActionController::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
test 'resources methods are not controller actions' do
|
38
|
-
assert @controller.class.action_methods.empty
|
38
|
+
assert @controller.class.action_methods.empty?
|
39
39
|
end
|
40
40
|
|
41
41
|
test 'require no authentication tests current mapping' do
|
@@ -28,31 +28,31 @@ class OmniAuthRoutesTest < ActionController::TestCase
|
|
28
28
|
end
|
29
29
|
|
30
30
|
test 'should generate authorization path' do
|
31
|
-
assert_match "/users/auth/facebook", @controller.
|
31
|
+
assert_match "/users/auth/facebook", @controller.omniauth_authorize_path(:user, :facebook)
|
32
32
|
|
33
33
|
assert_raise ArgumentError do
|
34
|
-
@controller.
|
34
|
+
@controller.omniauth_authorize_path(:user, :github)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
test 'should generate authorization path for named open_id omniauth' do
|
39
|
-
assert_match "/users/auth/google", @controller.
|
39
|
+
assert_match "/users/auth/google", @controller.omniauth_authorize_path(:user, :google)
|
40
40
|
end
|
41
41
|
|
42
42
|
test 'should generate authorization path with params' do
|
43
43
|
assert_match "/users/auth/open_id?openid_url=http%3A%2F%2Fyahoo.com",
|
44
|
-
@controller.
|
44
|
+
@controller.omniauth_authorize_path(:user, :open_id, :openid_url => "http://yahoo.com")
|
45
45
|
end
|
46
46
|
|
47
47
|
test 'should not add a "?" if no param was sent' do
|
48
48
|
assert_equal "/users/auth/open_id",
|
49
|
-
@controller.
|
49
|
+
@controller.omniauth_authorize_path(:user, :open_id)
|
50
50
|
end
|
51
51
|
|
52
52
|
test 'should set script name in the path if present' do
|
53
53
|
@request.env['SCRIPT_NAME'] = '/q'
|
54
54
|
|
55
55
|
assert_equal "/q/users/auth/facebook",
|
56
|
-
@controller.
|
56
|
+
@controller.omniauth_authorize_path(:user, :facebook)
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
- 9
|
10
|
+
version: 1.4.9
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- "Jos\xC3\xA9 Valim"
|
@@ -11,7 +16,7 @@ autorequire:
|
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
18
|
|
14
|
-
date: 2011-10-
|
19
|
+
date: 2011-10-20 00:00:00 +02:00
|
15
20
|
default_executable:
|
16
21
|
dependencies:
|
17
22
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +27,11 @@ dependencies:
|
|
22
27
|
requirements:
|
23
28
|
- - ~>
|
24
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 17
|
31
|
+
segments:
|
32
|
+
- 1
|
33
|
+
- 0
|
34
|
+
- 3
|
25
35
|
version: 1.0.3
|
26
36
|
type: :runtime
|
27
37
|
version_requirements: *id001
|
@@ -33,6 +43,11 @@ dependencies:
|
|
33
43
|
requirements:
|
34
44
|
- - ~>
|
35
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 25
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
- 3
|
36
51
|
version: 0.0.3
|
37
52
|
type: :runtime
|
38
53
|
version_requirements: *id002
|
@@ -44,6 +59,10 @@ dependencies:
|
|
44
59
|
requirements:
|
45
60
|
- - ~>
|
46
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 7
|
63
|
+
segments:
|
64
|
+
- 3
|
65
|
+
- 0
|
47
66
|
version: "3.0"
|
48
67
|
type: :runtime
|
49
68
|
version_requirements: *id003
|
@@ -273,17 +292,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
292
|
requirements:
|
274
293
|
- - ">="
|
275
294
|
- !ruby/object:Gem::Version
|
295
|
+
hash: 3
|
296
|
+
segments:
|
297
|
+
- 0
|
276
298
|
version: "0"
|
277
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
278
300
|
none: false
|
279
301
|
requirements:
|
280
302
|
- - ">="
|
281
303
|
- !ruby/object:Gem::Version
|
304
|
+
hash: 3
|
305
|
+
segments:
|
306
|
+
- 0
|
282
307
|
version: "0"
|
283
308
|
requirements: []
|
284
309
|
|
285
310
|
rubyforge_project: devise
|
286
|
-
rubygems_version: 1.
|
311
|
+
rubygems_version: 1.5.3
|
287
312
|
signing_key:
|
288
313
|
specification_version: 3
|
289
314
|
summary: Flexible authentication solution for Rails with Warden
|