From 74fd8743651d517cebbaef2afd1f706f703a6a56 Mon Sep 17 00:00:00 2001 From: Misi Date: Thu, 25 May 2023 14:04:56 +0200 Subject: [PATCH] AuthN: Fix render auth when clientTokenRotation is enabled (#68709) Add isRenderRequest check to scheduleTokenRotationJob --- public/app/core/services/context_srv.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/core/services/context_srv.ts b/public/app/core/services/context_srv.ts index d29bbc26a16..59884cd39a4 100644 --- a/public/app/core/services/context_srv.ts +++ b/public/app/core/services/context_srv.ts @@ -202,8 +202,10 @@ export class ContextSrv { // schedules a job to perform token ration in the background private scheduleTokenRotationJob() { - // only schedule job if feature toggle is enabled and user is signed in - if (config.featureToggles.clientTokenRotation && this.isSignedIn) { + const urlParams = new URLSearchParams(window.location.search); + const isRenderRequest = !!urlParams.get('render'); + // only schedule job if feature toggle is enabled, user is signed in and it's not a render request + if (config.featureToggles.clientTokenRotation && this.isSignedIn && !isRenderRequest) { // get the time token is going to expire let expires = this.getSessionExpiry();