filebrowser/auth/none.go
Henrique Dias 23938b624a fix: more verifications, elss errors
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>DeleteByUsername
2018-12-30 14:55:28 +00:00

21 lines
405 B
Go

package auth
import (
"net/http"
"github.com/filebrowser/filebrowser/types"
)
// MethodNoAuth is used to identify no auth.
const MethodNoAuth types.AuthMethod = "noauth"
// NoAuth is no auth implementation of auther.
type NoAuth struct {
Store *types.UsersVerify `json:"-"`
}
// Auth uses authenticates user 1.
func (a NoAuth) Auth(r *http.Request) (*types.User, error) {
return a.Store.Get(1)
}