add details to aud mismatch message

This commit is contained in:
Umputun
2019-11-05 12:19:01 -06:00
parent 9b570ae273
commit 95fa79241b
+1 -1
View File
@@ -62,7 +62,7 @@ func (s *private) createCommentCtrl(w http.ResponseWriter, r *http.Request) {
user := rest.MustGetUserInfo(r)
if user.ID != "admin" && user.SiteID != comment.Locator.SiteID {
rest.SendErrorJSON(w, r, http.StatusForbidden,
errors.New("site mismatch, not allowed to post to "+comment.Locator.SiteID), "invalid site",
fmt.Errorf("site mismatch, %q not allowed to post to %s", user.SiteID, comment.Locator.SiteID), "invalid site",
rest.ErrCommentValidation)
return
}