feat: pass repo access to middleware

This commit is contained in:
2025-06-15 19:25:13 +02:00
parent 0b1ef77689
commit dbff94e7b3
4 changed files with 6 additions and 4 deletions

View File

@ -89,7 +89,7 @@ func NewAuthHandler(repo *repository.Queries, cache *cache.Client, cfg *config.A
func (h *AuthHandler) RegisterRoutes(api chi.Router) {
api.Route("/auth", func(r chi.Router) {
r.Group(func(protected chi.Router) {
authMiddleware := imiddleware.NewAuthMiddleware(h.cfg)
authMiddleware := imiddleware.NewAuthMiddleware(h.cfg, h.repo)
protected.Use(authMiddleware.Runner)
protected.Get("/profile", h.getProfile)