AuthN: Fix render auth when clientTokenRotation is enabled (#68709)

Add isRenderRequest check to scheduleTokenRotationJob
This commit is contained in:
Misi 2023-05-25 14:04:56 +02:00 committed by GitHub
parent df4db412cb
commit 74fd874365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();