feat: add room by name endpoint for non-authenticated access

- Add GET /rooms/name/{room_name} backend endpoint
- Endpoint supports non-authenticated access for public rooms
- Returns RoomDetails with webhook fields hidden for non-owners
- Update useRoomGetByName hook to use new direct endpoint
- Remove authentication requirement from frontend hook
- Regenerate API client types

Fixes: Non-authenticated users can now access room lobbies
This commit is contained in:
2025-09-10 19:04:09 -06:00
parent e483e2a97f
commit 304f3dca3a
3 changed files with 2888 additions and 2843 deletions

View File

@@ -642,19 +642,16 @@ export function useRoomsCreateMeeting() {
// Calendar integration hooks
export function useRoomGetByName(roomName: string | null) {
const { isAuthenticated } = useAuthReady();
return $api.useQuery(
"get",
"/v1/rooms",
"/v1/rooms/name/{room_name}",
{
params: {
query: { page: 1 }, // We'll need to filter by room name on the client side
path: { room_name: roomName || "" },
},
},
{
enabled: !!roomName && isAuthenticated,
select: (data) => data.items?.find((room) => room.name === roomName),
enabled: !!roomName,
},
);
}