fix(auth): reject request body on session creation

This commit is contained in:
kk10
2026-10-20 23:03:39 +03:00
parent 85708b3417
commit c21f274776
2 changed files with 17 additions and 0 deletions
+4
View File
@@ -27,6 +27,10 @@ func (h *AuthHandler) CreateSession(w http.ResponseWriter, r *http.Request) {
return
}
if !httpx.RejectBody(w, r, requestID) {
return
}
session, err := h.service.Login(r.Context(), username, plain)
if errors.Is(err, service.ErrInvalidCredentials) {
httpx.WriteUnauthorized(w, httpx.BasicChallenge, requestID)