summaryrefslogtreecommitdiffstats
path: root/public/js/logout.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/logout.js')
-rw-r--r--public/js/logout.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/public/js/logout.js b/public/js/logout.js
new file mode 100644
index 0000000..b9ac400
--- /dev/null
+++ b/public/js/logout.js
@@ -0,0 +1,16 @@
+;(function () {
+ /**
+ * When JavaScript is available, trigger an XmlHTTPRequest with the non-existing user 'logout' and abort it
+ * before it is able to finish. This will cause the browser to show a new authentication prompt in the next
+ * request.
+ */
+ document.getElementById('logout-in-progress').hidden = true;
+ document.getElementById('logout-successful').hidden = false;
+ try {
+ var xhttp = new XMLHttpRequest();
+ xhttp.open('GET', 'arbitrary url', true, 'logout', 'logout');
+ xhttp.send('');
+ xhttp.abort();
+ } catch (e) {
+ }
+})();