From 1c84e8a56aa36f0418d611fbdabe59570e706a5c Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Mon, 29 Jul 2013 09:24:43 -0400 Subject: [PATCH] AC-301 attempting to prevent content flash between logins --- awx/ui/static/lib/ansible/authenticate.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awx/ui/static/lib/ansible/authenticate.js b/awx/ui/static/lib/ansible/authenticate.js index d49046b30f..b08c183159 100644 --- a/awx/ui/static/lib/ansible/authenticate.js +++ b/awx/ui/static/lib/ansible/authenticate.js @@ -66,6 +66,14 @@ angular.module('AuthService', ['ngCookies']) }, logout: function() { + // the following puts our primary scope up for garbage collection, which + // should prevent content flash from the prior user. + var scope = angular.element(getElementById('main-view')).scope(); + scope.$destroy(); + + // but just in case, clear the organization bits + scope.organizations = null; + $rootScope.current_user = {}; $rootScope.license_tested = undefined; $cookieStore.remove('token');