mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
refactor: cleanup package names (#5605)
This commit is contained in:
parent
a6934e40ff
commit
f029c3005e
33 changed files with 78 additions and 78 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package http
|
||||
package fbhttp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
|
@ -12,7 +12,7 @@ import (
|
|||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
fbErrors "github.com/filebrowser/filebrowser/v2/errors"
|
||||
fberrors "github.com/filebrowser/filebrowser/v2/errors"
|
||||
"github.com/filebrowser/filebrowser/v2/users"
|
||||
)
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ func getUserID(r *http.Request) (uint, error) {
|
|||
|
||||
func getUser(_ http.ResponseWriter, r *http.Request) (*modifyUserRequest, error) {
|
||||
if r.Body == nil {
|
||||
return nil, fbErrors.ErrEmptyRequest
|
||||
return nil, fberrors.ErrEmptyRequest
|
||||
}
|
||||
|
||||
req := &modifyUserRequest{}
|
||||
|
|
@ -46,7 +46,7 @@ func getUser(_ http.ResponseWriter, r *http.Request) (*modifyUserRequest, error)
|
|||
}
|
||||
|
||||
if req.What != "user" {
|
||||
return nil, fbErrors.ErrInvalidDataType
|
||||
return nil, fberrors.ErrInvalidDataType
|
||||
}
|
||||
|
||||
return req, nil
|
||||
|
|
@ -87,7 +87,7 @@ var usersGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *
|
|||
|
||||
var userGetHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||
u, err := d.store.Users.Get(d.server.Root, d.raw.(uint))
|
||||
if errors.Is(err, fbErrors.ErrNotExist) {
|
||||
if errors.Is(err, fberrors.ErrNotExist) {
|
||||
return http.StatusNotFound, err
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ var userPostHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *
|
|||
}
|
||||
|
||||
if req.Data.Password == "" {
|
||||
return http.StatusBadRequest, fbErrors.ErrEmptyPassword
|
||||
return http.StatusBadRequest, fberrors.ErrEmptyPassword
|
||||
}
|
||||
|
||||
req.Data.Password, err = users.ValidateAndHashPwd(req.Data.Password, d.settings.MinimumPasswordLength)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue