From d3cab8217f1f916dbc95793b3f4ca668615814b5 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:37:03 +0200 Subject: [PATCH] [release-11.5.2] Auth: Fix redirect with JWT auth URL login (#100355) Auth: Fix redirect with JWT auth URL login (#100295) fix (cherry picked from commit acc15219296206fb1a971b3742110e6a9d972cef) Co-authored-by: Misi --- public/app/app.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app/app.ts b/public/app/app.ts index 17ba4c04d73..d7fc255af6c 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -401,6 +401,11 @@ function handleRedirectTo(): void { const queryParams = locationService.getSearch(); const redirectToParamKey = 'redirectTo'; + if (queryParams.has('auth_token')) { + // URL Login should not be redirected + window.sessionStorage.removeItem(RedirectToUrlKey); + } + if (queryParams.has(redirectToParamKey) && window.location.pathname !== '/') { const rawRedirectTo = queryParams.get(redirectToParamKey)!; window.sessionStorage.setItem(RedirectToUrlKey, encodeURIComponent(rawRedirectTo));