Merge pull request 'fix(auth): typed context keys and real sentinel errors' (#4) from devin/1776538999-fix-auth-context-keys-and-errors into master
This commit was merged in pull request #4.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/explorer/backend/api/middleware"
|
||||
"github.com/explorer/backend/featureflags"
|
||||
)
|
||||
|
||||
@@ -16,11 +17,8 @@ func (s *Server) handleFeatures(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// Extract user track from context (set by auth middleware)
|
||||
// Default to Track 1 (public) if not authenticated
|
||||
userTrack := 1
|
||||
if track, ok := r.Context().Value("user_track").(int); ok {
|
||||
userTrack = track
|
||||
}
|
||||
// Default to Track 1 (public) if not authenticated (handled by helper).
|
||||
userTrack := middleware.UserTrack(r.Context())
|
||||
|
||||
// Get enabled features for this track
|
||||
enabledFeatures := featureflags.GetEnabledFeatures(userTrack)
|
||||
|
||||
Reference in New Issue
Block a user