we_bridge_rails_engine_users 0.1.6 → 0.1.7
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a1a91fad1e99b7e82b231a7966b470d41cb5d0a
|
4
|
+
data.tar.gz: 469e86a211d4101af4f676105bc7f4cbbe0cf1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d3903fba9c25c4d0f05b815ceb287968eb69826da77ba212794e6d28c4676bc46e52c155970493ba083c9822585e21ab60d4d70bea8d354faf111c134cdfa4
|
7
|
+
data.tar.gz: cf09b15e73136fd07ff0fed2c6a9ff408cafed318cadcf236c2f0d9f277c3b9dc7b10bcfb5031fe7a20ebba4eba9799d094d1e3b8d1d1fa477f6be015250da81
|
@@ -4,7 +4,7 @@ class SessionsController < ApplicationController
|
|
4
4
|
def login
|
5
5
|
@providers = []
|
6
6
|
WeBridgeRailsEngineUsers::ProviderSettings.availables do |name|
|
7
|
-
@providers << {url: WeBridgeRailsEngineUsers::ProviderSettings.
|
7
|
+
@providers << {url: WeBridgeRailsEngineUsers::ProviderSettings.auth_path(name), display: name.to_s.capitalize }
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'rubygems'
|
3
|
+
|
3
4
|
module WeBridgeRailsEngineUsers
|
4
5
|
class ProviderSettings < Hash
|
5
6
|
|
@@ -43,20 +44,40 @@ module WeBridgeRailsEngineUsers
|
|
43
44
|
rtn
|
44
45
|
end
|
45
46
|
|
47
|
+
# the return value does not include relative_url_root
|
46
48
|
def self.request_path(name)
|
47
|
-
File.join("/",
|
49
|
+
File.join("/","auth",name.to_s)
|
48
50
|
end
|
49
51
|
|
52
|
+
# the return value does not include relative_url_root
|
50
53
|
def self.callback_path(name)
|
51
|
-
File.join("/",
|
54
|
+
File.join("/","auth",name.to_s,"callback")
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.auth_as(name)
|
58
|
+
"auth_#{name}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.auth_path_method(name)
|
62
|
+
self.auth_as(name) + "_path"
|
63
|
+
end
|
64
|
+
|
65
|
+
# the return value includes relative_url_root
|
66
|
+
def self.auth_path(name)
|
67
|
+
Rails.application.routes.url_helpers.__send__(self.auth_path_method(name))
|
52
68
|
end
|
53
69
|
|
54
70
|
def self.auth_callback_as(name)
|
55
71
|
"auth_callback_#{name}"
|
56
72
|
end
|
57
73
|
|
58
|
-
def self.
|
59
|
-
|
74
|
+
def self.auth_callback_path_method(name)
|
75
|
+
self.auth_callback_as(name) + "_path"
|
76
|
+
end
|
77
|
+
|
78
|
+
# the return value includes relative_url_root
|
79
|
+
def self.auth_callback_path(name)
|
80
|
+
Rails.application.routes.url_helpers.__send__(self.auth_callback_path_method(name))
|
60
81
|
end
|
61
82
|
|
62
83
|
def self.set_middleware
|
Binary file
|