Skip to content

Commit 087c52f

Browse files
committed
instanciar hasher
1 parent 46bea7c commit 087c52f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ func main() {
4040
addressRepo := addresses.NewPostgresAddressRepository(dbPool)
4141
cartRepo := cart.NewPostgresCartRepository(dbPool)
4242
orderRepo := orders.NewPostgresOrderRepository(dbPool)
43-
authHandler := handlers.NewAuthHandler(userRepo, cfg.JWTSecret, defaultJWTExpiry)
43+
44+
// Instantiate the password hasher
45+
hasher := auth.NewBcryptPasswordHasher()
46+
47+
// Pass the hasher to NewAuthHandler
48+
authHandler := handlers.NewAuthHandler(userRepo, hasher, cfg.JWTSecret, defaultJWTExpiry)
4449
userHandler := handlers.NewUserHandler(userRepo, addressRepo)
4550
productHandler := handlers.NewProductHandler(productRepo)
4651
categoryHandler := handlers.NewCategoryHandler(categoryRepo)

0 commit comments

Comments
 (0)