mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 18:12:09 +00:00
Handle authenticated room instance takeover
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user