rack-cas-rails 1.0.1 → 1.0.2
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: 5d6b199a30ac3ef25737bafced3e25ea583cb8e3
|
4
|
+
data.tar.gz: 005a4de1f09492f9ef93ead05471676abb683cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
44
|
-
|
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
|