diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-21 08:47:12 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-11-21 08:47:12 +0000 |
commit | 57ff384203570508e81cdf5dfaa0cb96478e7654 (patch) | |
tree | baa71ee27ee1354cb633cd578c9d36fb15485124 /sca-cpp/trunk/modules/edit/htdocs/public/oops | |
parent | 5a4e8af02b6fc5fefc5f7a2a95cc1e735759c40a (diff) |
Improvements to the auth implementation. Refactor logout page, handle auth redirects in XHR responses and allow auth to work off an OpenID AX attribute or OAuth resource attribute.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1204401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/edit/htdocs/public/oops')
-rw-r--r-- | sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html b/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html index 8cfe2f6537..ca3e7706e3 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html @@ -110,13 +110,27 @@ var cdiv = $('content'); function showmenu(mdiv) { mdiv.innerHTML = ui.menubar( mklist(ui.menu('Home', '/', '_view', false)), - mklist(ui.signedin()? ui.menu('Sign out', '/logout/', '_self', false) : ui.menu('Sign in', '/login/', '_self', false))); + mklist(ui.signedin()? ui.menufunc('Sign out', 'logout();', false) : ui.menu('Sign in', '/login/', '_self', false))); } showmenu(mdiv); cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight); /** + * Log the current user out. + */ +function logout() { + // Clear session cookie and user-specific local storage entries + var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/'; + document.cookie = reset; + localStorage.removeItem('/r/EditWidget/accounts'); + localStorage.removeItem('/r/EditWidget/dashboards'); + //localStorage.clear(); + document.location = '/login/'; + return true; +} + +/** * Handle orientation change. */ document.body.onorientationchange = function(e) { |