fixed issues from opencode agent

This commit is contained in:
2026-05-13 01:08:19 +02:00
parent 994570ca74
commit dea58b85b8
6 changed files with 29 additions and 14 deletions
+5 -1
View File
@@ -11,6 +11,7 @@ import (
"strings"
"time"
"golang.org/x/crypto/bcrypt"
"xorm.io/xorm"
"github.com/forgeo/forgebucket/internal/domain/oci"
@@ -513,7 +514,7 @@ func newOCIUploadID() string {
}
func (h *OCIRegistryHandler) basicAuthOCI(r *http.Request) string {
u, _, hasAuth := r.BasicAuth()
u, pass, hasAuth := r.BasicAuth()
if !hasAuth {
return ""
}
@@ -521,5 +522,8 @@ func (h *OCIRegistryHandler) basicAuthOCI(r *http.Request) string {
if found, _ := h.db.Where("username = ?", u).Get(&user); !found {
return ""
}
if err := bcrypt.CompareHashAndPassword([]byte(user.PasswordHash), []byte(pass)); err != nil {
return ""
}
return u
}