fixed issues from opencode agent
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user