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: 1a7826139a63c532db7cf3694ab2b9b94e47a1d7
4
- data.tar.gz: 2f56b5d88b08c9fef1df7bf640797d00a596376d
3
+ metadata.gz: 3a1a91fad1e99b7e82b231a7966b470d41cb5d0a
4
+ data.tar.gz: 469e86a211d4101af4f676105bc7f4cbbe0cf1bd
5
5
  SHA512:
6
- metadata.gz: 4a682fdb4d648b30ca8377fab74846b99c6f4f699303eb6ddc54274cc6195a28566d9683bc3a23bae5521fd6d78d4f2de395d8e3f5d969f0b9e4eae8e2967615
7
- data.tar.gz: ac0e53ef58220b284f13ee3914a67fb532729cd5558bd1cb05ef6a807ea0fe88087732d76440613fdd3fda8501234b26e315e09b4dca1663ad809a88ee883a26
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.request_path(name), display: name.to_s.capitalize }
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("/",Rails.application.config.relative_url_root.to_s,"auth",name.to_s)
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("/",Rails.application.config.relative_url_root.to_s,"auth",name.to_s,"callback")
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.auth_as(name)
59
- "auth_#{name}"
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
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineUsers
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
Binary file