diff --git a/public/app/core/services/global_event_srv.ts b/public/app/core/services/global_event_srv.ts index 953c57437c5..2351c86ee1c 100644 --- a/public/app/core/services/global_event_srv.ts +++ b/public/app/core/services/global_event_srv.ts @@ -6,10 +6,12 @@ import appEvents from "app/core/app_events"; // Good for communication react > angular and vice verse export class GlobalEventSrv { private appSubUrl; + private fullPageReloadRoutes; /** @ngInject */ - constructor(private $location, private $timeout) { + constructor(private $location, private $timeout, private $window) { this.appSubUrl = config.appSubUrl; + this.fullPageReloadRoutes = ["/logout"]; } // Angular's $location does not like and absolute urls @@ -27,6 +29,10 @@ export class GlobalEventSrv { init() { appEvents.on("location-change", payload => { const urlWithoutBase = this.stripBaseFromUrl(payload.href); + if (this.fullPageReloadRoutes.indexOf(urlWithoutBase) > -1) { + this.$window.location.href = payload.href; + return; + } this.$timeout(() => { // A hack to use timeout when we're changing things (in this case the url) from outside of Angular. diff --git a/public/app/core/specs/global_event_srv.jest.ts b/public/app/core/specs/global_event_srv.jest.ts index d444e822ecd..1223814fb38 100644 --- a/public/app/core/specs/global_event_srv.jest.ts +++ b/public/app/core/specs/global_event_srv.jest.ts @@ -1,4 +1,4 @@ -import { GlobalEventSrv } from "app/core/services/global_event_srv"; +import { GlobalEventSrv } from "app/core/services/global_event_srv"; import { beforeEach } from "test/lib/common"; jest.mock("app/core/config", () => { @@ -11,7 +11,7 @@ describe("GlobalEventSrv", () => { let searchSrv; beforeEach(() => { - searchSrv = new GlobalEventSrv(null, null); + searchSrv = new GlobalEventSrv(null, null, null); }); describe("With /subUrl as appSubUrl", () => {