Accept any struct with GetPasswordHash implementation

This commit is contained in:
Melon 2024-05-14 11:02:11 +01:00
parent e6eaaedb44
commit 7f0158e450
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -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 {