feat: hook authentication method

This commit is contained in:
Ramires Viana 2021-09-13 13:47:06 +00:00 committed by Oleg Lobanov
parent f80b016ef0
commit dda9a389f3
12 changed files with 340 additions and 14 deletions

View file

@ -14,8 +14,8 @@ const MethodNoAuth settings.AuthMethod = "noauth"
type NoAuth struct{}
// Auth uses authenticates user 1.
func (a NoAuth) Auth(r *http.Request, sto users.Store, root string) (*users.User, error) {
return sto.Get(root, uint(1))
func (a NoAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error) {
return usr.Get(srv.Root, uint(1))
}
// LoginPage tells that no auth doesn't require a login page.