Started work on crash reporting

This commit is contained in:
Caleb Gardner
2024-05-30 06:35:57 -05:00
parent 144f45293b
commit 228f0ff86d
4 changed files with 62 additions and 30 deletions
+6
View File
@@ -118,6 +118,9 @@ func (b *Backend) CreateUser(w http.ResponseWriter, r *http.Request) {
if hdr.k == nil || !hdr.k.Perm["user"] || errors.Is(err, ErrApiKeyUnauthorized) {
ReturnError(w, http.StatusUnauthorized, "invalidKey", "Application not authorized")
return
} else if err != nil {
ReturnError(w, http.StatusInternalServerError, "internal", "Server error")
return
}
defer r.Body.Close()
var req createUserRequest
@@ -186,6 +189,9 @@ func (b *Backend) Login(w http.ResponseWriter, r *http.Request) {
if hdr.k == nil || !hdr.k.Perm["user"] || errors.Is(err, ErrApiKeyUnauthorized) {
ReturnError(w, http.StatusUnauthorized, "invalidKey", "Application not authorized")
return
} else if err != nil {
ReturnError(w, http.StatusInternalServerError, "internal", "Server error")
return
}
defer r.Body.Close()
var req loginRequest