From 5dbefdecfe611f9496f9105a62e8f46ccb927add Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 5 Nov 2015 11:54:40 -0800 Subject: PLT-1016 force logout on other browsers --- web/templates/head.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'web/templates') diff --git a/web/templates/head.html b/web/templates/head.html index a73e809a7..2bbf921ee 100644 --- a/web/templates/head.html +++ b/web/templates/head.html @@ -52,6 +52,15 @@ headers: { 'X-MM-TokenIndex': mm_session_token_index } }); } + + $(function () { + $(window).bind('storage', function (e) { + if (e.originalEvent.key === '__logout__') { + console.log('detected logout from a different tab'); + window.location.href = '/' + window.mm_team.name; + } + }); + });