rack-cas-rails 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 988be7061ebaeb5442653431431c27c25fc071d0
4
- data.tar.gz: 6a247938deeca39efa092bd5f5a00e2f786e05d8
3
+ metadata.gz: 5d6b199a30ac3ef25737bafced3e25ea583cb8e3
4
+ data.tar.gz: 005a4de1f09492f9ef93ead05471676abb683cfb
5
5
  SHA512:
6
- metadata.gz: 7d7b45a409147af794cd95aa20cff466e8016b4477a80e99806a3142643fd6c486788482f12846adfe2097e9a51259734a6336224dbb992b739c2260c64228df
7
- data.tar.gz: 9c33e2ee916134ad64529ade3debd7127d1b72ae662dd465d31b311e808929d94d60283e4b3201d2f012dbb6ba228b39d12f8a2074a18c78a2df6caab7668dc0
6
+ metadata.gz: 91265d8e991a5a56d62dbf9ddb5a20fe65fc3995129bbea1cf5f21fd85a0b15e84feb65dc5ab7d8bed2c7d195ba473511c2e6b2e91fd5638a93cd7ef4c57390f
7
+ data.tar.gz: 42f095b31dd0676a5df97a4938e323db9c628ea341e9554899270af92ef414239d25cf55c802764b0f794b182c00f01d8a392084f764d63eba068fec7bee5f40
@@ -38,10 +38,19 @@ module RackCASRails
38
38
  # which is actually undocumented. I had to find out by looking into the source code of the rack-cas gem.
39
39
  # @param service_url [String] Optional url to redirect to after authentication.
40
40
  # @return [String] The CAS logout URL.
41
+ # @note
42
+ # This helper depends on your application having a root route, so that the *root_url* helper is defined. Otherwise,
43
+ # it degrades to current request URL's scheme + host + port + "/logout", which may not be what you want, especially in
44
+ # sub-URI hosting situations.
41
45
 
42
46
  def logout_url(service_url=request.url)
43
- url = URI(request.url)
44
- url.path = "/logout"
47
+ if self.respond_to?(:root_url)
48
+ url = URI(root_url)
49
+ url.path += "logout"
50
+ else
51
+ url = URI(request.url)
52
+ url.path = "/logout"
53
+ end
45
54
  url.query = "service=#{service_url || request.url}"
46
55
  url.to_s
47
56
  end
@@ -1,4 +1,3 @@
1
- ##
2
1
  # Augments the Rails::Application class.
3
2
 
4
3
  Rails::Application.class_eval do
@@ -1,3 +1,3 @@
1
1
  module RackCASRails
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-cas-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Brazil