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

@ -25,7 +25,7 @@ func NewOAuthHandler(repo *repository.Queries, cache *cache.Client, cfg *config.
func (h *OAuthHandler) RegisterRoutes(router chi.Router) {
router.Route("/oauth", 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.Post("/code", h.getAuthCode)