Auth: Fix identifying rendering request (#80807)

* Auth: Fix identifying rendering request

* Add comments
This commit is contained in:
Alexander Zobnin 2024-01-18 17:56:01 +03:00 committed by GitHub
parent dafd7c7920
commit 484ced521f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {