From f177d6940962d369d9a43bab6d69a3a6a459d542 Mon Sep 17 00:00:00 2001 From: restrry Date: Fri, 6 Mar 2020 12:39:24 +0100 Subject: [PATCH] do not fail on FakrRequest --- src/core/server/http/router/request.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 3ec31b823a790..f266677c1a172 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -178,7 +178,8 @@ export class KibanaRequest< this.events = this.getEvents(request); this.auth = { - isAuthenticated: request.auth.isAuthenticated, + // missing in fakeRequests, so we cast to false + isAuthenticated: Boolean(request.auth?.isAuthenticated), }; }