feat: hook authentication method

This commit is contained in:
Ramires Viana authored and Oleg Lobanov committed 2022-07-20 16:40:49 +02:00
1 parent f80b016ef0
commit dda9a389f3
12 files changed
+340 -14

No files matched your search

+2 -2
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.