Skip to content

Commit

Permalink
Fix poker game endpoint to ignore duplicate user
Browse files Browse the repository at this point in the history
This fixes #641
  • Loading branch information
StevenWeathers committed Oct 29, 2024
1 parent 64d2922 commit a651214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/http/poker.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (s *Service) handleGetPokerGame() http.HandlerFunc {
// don't allow retrieving battle details if battle has JoinCode and user hasn't joined yet
if game.JoinCode != "" {
userErr := s.PokerDataSvc.GetUserActiveStatus(gameID, sessionUserID)
if userErr != nil && userType != thunderdome.AdminUserType {
if userErr != nil && userErr.Error() != "DUPLICATE_BATTLE_USER" && userType != thunderdome.AdminUserType {
s.Failure(w, r, http.StatusForbidden, Errorf(EUNAUTHORIZED, "USER_MUST_JOIN_BATTLE"))
return
}
Expand Down

0 comments on commit a651214

Please sign in to comment.