Browse Source

temp: Revert to placeholder user data in game handler

Temporarily revert to hardcoded user data instead of auth context
values. This appears to be debugging/development code that should
be reverted back to proper authentication context usage before
production deployment.

Note: This should be changed back to use actual auth context values.
main
Stephanie Gredell 5 months ago
parent
commit
5f5766f784
  1. 6
      router/handlers/game.go

6
router/handlers/game.go

@ -5,7 +5,6 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"systemdesigngame/internal/auth"
"systemdesigngame/internal/level" "systemdesigngame/internal/level"
) )
@ -21,9 +20,8 @@ func (h *PlayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
username := r.Context().Value(auth.UserLoginKey).(string) username := "something"
avatar := r.Context().Value(auth.UserAvatarKey).(string) avatar := "something"
lvl, err := level.GetLevel(strings.ToLower(levelName), level.DifficultyEasy) lvl, err := level.GetLevel(strings.ToLower(levelName), level.DifficultyEasy)
if err != nil { if err != nil {
http.Error(w, "Level not found: "+err.Error(), http.StatusNotFound) http.Error(w, "Level not found: "+err.Error(), http.StatusNotFound)

Loading…
Cancel
Save