mirror of
https://github.com/1f349/cardcaldav.git
synced 2024-11-09 14:33:20 +00:00
Accept any struct with GetPasswordHash implementation
This commit is contained in:
parent
e6eaaedb44
commit
7f0158e450
6
auth.go
6
auth.go
@ -52,7 +52,11 @@ func NewAuth(dbStr string, logger *log.Logger) *Auth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
DB *database.Queries
|
DB DbQueries
|
||||||
|
}
|
||||||
|
|
||||||
|
type DbQueries interface {
|
||||||
|
GetPasswordHash(ctx context.Context, username string) (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auth) Middleware(next http.Handler) http.Handler {
|
func (a *Auth) Middleware(next http.Handler) http.Handler {
|
||||||
|
Loading…
Reference in New Issue
Block a user