Skip to content

feat: redirect players to game page when game ends#2544

Open
khushal-winner wants to merge 1 commit intoOWASP:masterfrom
khushal-winner:feature/game-end-player-redirect
Open

feat: redirect players to game page when game ends#2544
khushal-winner wants to merge 1 commit intoOWASP:masterfrom
khushal-winner:feature/game-end-player-redirect

Conversation

@khushal-winner
Copy link
Contributor

@khushal-winner khushal-winner commented Mar 6, 2026

Closes - #2539

  • Add game_finished?/1 function to Game module
  • Implement game-end redirect in PlayerLive.Show
  • Redirect from /games/:game_id/players/:player_id to /games/:game_id
  • Handle both initial access and real-time game end events
  • Use push_navigate for seamless LiveView redirects
2026-03-06.23-35-50.mp4

Fixes issue where players could access finished game pages instead of being redirected to game summary.

- Add game_finished?/1 function to Game module
- Implement game-end redirect in PlayerLive.Show
- Redirect from /games/:game_id/players/:player_id to /games/:game_id
- Handle both initial access and real-time game end events
- Use push_navigate for seamless LiveView redirects

Fixes issue where players could access finished game pages instead of being redirected to game summary.
@sydseter
Copy link
Collaborator

I’ll need to test this out, but it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants