diff --git a/pkg/api/user.go b/pkg/api/user.go index 22e92e59e7a..8bc33207ac1 100644 --- a/pkg/api/user.go +++ b/pkg/api/user.go @@ -505,7 +505,7 @@ func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *contextmodel.ReqContex if !c.SignedInUser.IsIdentityType(claims.TypeUser) { hs.log.Debug("Requested endpoint only available to users") - c.JsonApiErr(http.StatusForbidden, "Endpoint only available for users", nil) + c.JsonApiErr(http.StatusNotModified, "Endpoint only available for users", nil) return } @@ -631,7 +631,7 @@ func (hs *HTTPServer) ClearHelpFlags(c *contextmodel.ReqContext) response.Respon func (hs *HTTPServer) getUserID(c *contextmodel.ReqContext) (int64, *response.NormalResponse) { if !c.SignedInUser.IsIdentityType(claims.TypeUser) { hs.log.Debug("Requested endpoint only available to users") - return 0, response.Error(http.StatusForbidden, "Endpoint only available for users", nil) + return 0, response.Error(http.StatusNotModified, "Endpoint only available for users", nil) } userID, err := c.SignedInUser.GetInternalID() diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index 3f2c645a300..f0f42225547 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -347,8 +347,9 @@ export class BackendSrv implements BackendService { } showErrorAlert(config: BackendSrvRequest, err: FetchError) { - // do not show error alerts for api keys or render tokens, they are used for kiosk mode and reporting and can't react to error pop-ups + // do not show non-user error alerts for api keys or render tokens, they are used for kiosk mode and reporting and can't react to error pop-ups if ( + (err.status < 400 || err.status >= 500) && this.dependencies.contextSrv.isSignedIn && (this.dependencies.contextSrv.user.authenticatedBy === 'apikey' || this.dependencies.contextSrv.user.authenticatedBy === 'render')