Fix: prevent joining games already in progress#2626
Open
xovishnukosuri wants to merge 1 commit intoOWASP:masterfrom
Open
Fix: prevent joining games already in progress#2626xovishnukosuri wants to merge 1 commit intoOWASP:masterfrom
xovishnukosuri wants to merge 1 commit intoOWASP:masterfrom
Conversation
Closes OWASP#2521. Players could join a game after it had started by navigating directly to the join URL, allowing them to watch and vote without being dealt any cards. This adds a started_at check in both the join page mount (PlayerLive.Index) and the player creation handler (PlayerLive.FormComponent) to block joining started games. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2521
/games/:game_id/players/new, allowing them to watch the game in real time and vote on cards without being dealt any cards themselves.started_atcheck inPlayerLive.Index.apply_action(:new, ...)to redirect users away from the join form if the game has already started.started_atcheck inPlayerLive.FormComponent.save_player(:new, ...)to reject player creation even if the form was loaded before the game started (race condition).Changes
copi.owasp.org/lib/copi_web/live/player_live/index.ex— checkgame.started_atinapply_action(:new, ...)and redirect with error flashcopi.owasp.org/lib/copi_web/live/player_live/form_component.ex— re-fetch game insave_player(:new, ...)and reject ifstarted_atis setTest plan
/games/:game_id/players/new— should be redirected to the game page with an error flash🤖 Generated with Claude Code