Interface: RouteOptions
Defined in: server/gateway.ts:57
How routeToRoom finds rooms and decides who may connect.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
rooms | RoomNamespace | Durable Object namespace of your Room class, e.g. env.ROOMS. | server/gateway.ts:59 |
prefix? | string | URL prefix rooms live under. Defaults to /rooms. | server/gateway.ts:61 |
Methods
authenticate()
ts
authenticate(request, roomId):
| Response
| Authenticated
| Promise<Response | Authenticated>;Defined in: server/gateway.ts:69
Work out who is connecting. Return the player's id (or { id, name }), or a Response to refuse the connection. This is the only place identity is established: rooms trust whatever this returns. roomId is the room being opened. tokenAuth gives you one that checks signed join tokens, and Accounts.authenticate one that also knows signed-in players.
Parameters
| Parameter | Type |
|---|---|
request | Request |
roomId | string |
Returns
| Response | Authenticated | Promise<Response | Authenticated>