[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 acc1521929)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2025-02-12 20:37:03 +02:00
committed by GitHub
co-authored by Misi
parent e8887275ae
commit d3cab8217f
+5
View File
@@ -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));