diff --git a/pkg/api/preferences.go b/pkg/api/preferences.go index e2fcef6976e..9debd431f60 100644 --- a/pkg/api/preferences.go +++ b/pkg/api/preferences.go @@ -66,7 +66,7 @@ func (hs *HTTPServer) SetHomeDashboard(c *contextmodel.ReqContext) response.Resp func (hs *HTTPServer) GetUserPreferences(c *contextmodel.ReqContext) response.Response { userID, err := identity.UserIdentifier(c.SignedInUser.GetID()) if err != nil { - return response.Error(http.StatusInternalServerError, "Failed to update user preferences", err) + return response.Error(http.StatusUnauthorized, "Not a valid identity", err) } return prefapi.GetPreferencesFor(c.Req.Context(), hs.DashboardService, hs.preferenceService, c.SignedInUser.GetOrgID(), userID, 0)