diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-04-02 06:23:35 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-04-02 06:23:35 +0000 |
commit | 54b61a4f65fb36be0bc3f190707aac2c4226a4a9 (patch) | |
tree | 5558f85da71d2f0a530001412f339fdc51495315 /sca-cpp/trunk/modules/js | |
parent | d28e692331d0fa5cc4a8aa010f4c715da07abf7e (diff) |
Support multiple Auth modules in a single server or proxy config. Minor fixes to the OAuth2 module to comply with the spec.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1308244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/js')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.js | 7 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/util.js | 22 |
2 files changed, 22 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js index eabf851b55..dcc1462084 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.js +++ b/sca-cpp/trunk/modules/js/htdocs/ui.js @@ -193,13 +193,6 @@ ui.windowtitle = function(host) { }; /** - * Return true if the session cookie contains signin information. - */ -ui.signedin = function() { - return !isNil(document.cookie) && document.cookie.indexOf('TuscanyOpenAuth=') != -1; -}; - -/** * Convert a CSS position to a numeric position. */ ui.numpos = function(p) { diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js index 60c8a0c8e6..677132d2a8 100644 --- a/sca-cpp/trunk/modules/js/htdocs/util.js +++ b/sca-cpp/trunk/modules/js/htdocs/util.js @@ -334,6 +334,28 @@ function issubdomain(host) { } /** + * Return true if the document cookie contains auth information. + */ +function hasauthcookie() { + return !isNil(document.cookie) && + (document.cookie.indexOf('TuscanyOpenAuth=') != -1 || + document.cookie.indexOf('TuscanyOAuth1=') != -1 || + document.cookie.indexOf('TuscanyOAuth2=') != -1 || + document.cookie.indexOf('TuscanyOpenIDAuth=') != -1); +} + +/** + * Clear auth information from the document cookie. + */ +function clearauthcookie() { + document.cookie = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = 'TuscanyOAuth1=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = 'TuscanyOAuth2=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = 'TuscanyOpenIDAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + return true; +} + +/** * Format a string like Python format. */ function format() { |