summaryrefslogtreecommitdiff
path: root/pkg/basic_auth
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/basic_auth')
-rw-r--r--pkg/basic_auth/middleware.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/basic_auth/middleware.go b/pkg/basic_auth/middleware.go
index 108124f..94cac56 100644
--- a/pkg/basic_auth/middleware.go
+++ b/pkg/basic_auth/middleware.go
@@ -6,6 +6,7 @@ import (
"time"
"git.adyxax.org/adyxax/tfstated/pkg/database"
+ "git.adyxax.org/adyxax/tfstated/pkg/model"
)
func Middleware(db *database.DB) func(http.Handler) http.Handler {
@@ -32,7 +33,7 @@ func Middleware(db *database.DB) func(http.Handler) http.Handler {
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
return
}
- ctx := context.WithValue(r.Context(), "account", account)
+ ctx := context.WithValue(r.Context(), model.AccountContextKey{}, account)
next.ServeHTTP(w, r.WithContext(ctx))
})
}