Handle authenticated room instance takeover
CI/CD / test_and_check_app (push) Failing after 2m7s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-09-10 16:33:13 +02:00
parent 2ab95cebdf
commit 640a2970c3
18 changed files with 351 additions and 22 deletions
@@ -8,6 +8,7 @@ use App\Http\Resources\RoomResource;
use App\Models\Room;
use App\Services\Rooms\RoomPageService;
use App\Services\Rooms\RoomParticipationService;
use App\Services\Rooms\RoomPlayerInstanceService;
use Inertia\Inertia;
use Inertia\Response;
@@ -16,6 +17,7 @@ class EmbeddedRoomController extends Controller
public function __construct(
private readonly RoomParticipationService $roomParticipation,
private readonly RoomPageService $roomPage,
private readonly RoomPlayerInstanceService $playerInstances,
) {}
public function __invoke(ShowEmbeddedRoomRequest $request): Response
@@ -33,6 +35,11 @@ class EmbeddedRoomController extends Controller
$validated['player_name'],
$request->session()->get("room_players.{$room->id}"),
);
$player = $this->roomParticipation->activateInstance(
$room,
$player,
$this->playerInstances->for($request),
);
$request->session()->put("room_players.{$room->id}", $player->id);