mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
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:
@@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user