2019-01-06 06:44:33 +08:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/filebrowser/filebrowser/v2/settings"
|
|
|
|
"github.com/filebrowser/filebrowser/v2/users"
|
|
|
|
)
|
|
|
|
|
|
|
|
// MethodNoAuth is used to identify no auth.
|
|
|
|
const MethodNoAuth settings.AuthMethod = "noauth"
|
|
|
|
|
|
|
|
// NoAuth is no auth implementation of auther.
|
2019-01-08 04:34:44 +08:00
|
|
|
type NoAuth struct{}
|
2019-01-06 06:44:33 +08:00
|
|
|
|
|
|
|
// Auth uses authenticates user 1.
|
2019-01-08 16:57:24 +08:00
|
|
|
func (a NoAuth) Auth(r *http.Request, sto *users.Storage, root string) (*users.User, error) {
|
2019-01-08 04:34:44 +08:00
|
|
|
return sto.Get(root, 1)
|
2019-01-06 06:44:33 +08:00
|
|
|
}
|