From 484ced521fdbeeff6db44a90365aa3321897e782 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 18 Jan 2024 17:56:01 +0300 Subject: [PATCH] Auth: Fix identifying rendering request (#80807) * Auth: Fix identifying rendering request * Add comments --- pkg/api/index.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/api/index.go b/pkg/api/index.go index 5bd1b1860bf..7c67ddb6250 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -221,6 +221,12 @@ func (hs *HTTPServer) getUserAuthenticatedBy(c *contextmodel.ReqContext, userID return "" } + // Special case for image renderer. Frontend relies on this information + // to render dashboards in a bit different way. + if c.IsRenderCall { + return login.RenderModule + } + info, err := hs.authInfoService.GetAuthInfo(c.Req.Context(), &login.GetAuthInfoQuery{UserId: userID}) // we ignore errors where a user does not have external user auth if err != nil && !errors.Is(err, user.ErrUserNotFound) {