Add missing auditRec.Success calls; fix missing return on error. (#34954)

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Doug Lauder
2026-01-27 23:07:53 +00:00
committed by GitHub
co-authored by Mattermost Build
parent 73d7e66e97
commit b2eb45e615
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -125,6 +125,8 @@ func remoteClusterAcceptMessage(c *Context, w http.ResponseWriter, r *http.Reque
return
}
auditRec.Success()
if _, err := w.Write(b); err != nil {
c.Logger.Warn("Error while writing response", mlog.Err(err))
}
@@ -575,8 +577,11 @@ func generateRemoteClusterInvite(c *Context, w http.ResponseWriter, r *http.Requ
inviteCode, invErr := c.App.CreateRemoteClusterInvite(rc.RemoteId, url, rc.Token, password)
if invErr != nil {
c.Err = invErr
return
}
auditRec.Success()
w.WriteHeader(http.StatusCreated)
if err := json.NewEncoder(w).Encode(inviteCode); err != nil {
c.Logger.Warn("Error while writing response", mlog.Err(err))
+1
View File
@@ -235,6 +235,7 @@ func uninviteRemoteClusterToChannel(c *Context, w http.ResponseWriter, r *http.R
// if the channel is not shared with the remote, we return early
if !hasRemote {
auditRec.Success()
w.WriteHeader(http.StatusNoContent)
return
}