File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,8 +37,9 @@ export async function POST(req: Request) {
3737
3838 // Parse room config from request body.
3939 const body = await req . json ( ) ;
40- // Recreate the RoomConfiguration object from JSON object.
41- const roomConfig = RoomConfiguration . fromJson ( body ?. room_config , { ignoreUnknownFields : true } ) ;
40+ const roomConfig = body ?. room_config
41+ ? RoomConfiguration . fromJson ( body . room_config , { ignoreUnknownFields : true } )
42+ : new RoomConfiguration ( ) ;
4243
4344 // Generate participant token
4445 const participantName = 'user' ;
@@ -73,7 +74,7 @@ export async function POST(req: Request) {
7374function createParticipantToken (
7475 userInfo : AccessTokenOptions ,
7576 roomName : string ,
76- roomConfig : RoomConfiguration
77+ roomConfig : RoomConfiguration | undefined
7778) : Promise < string > {
7879 const at = new AccessToken ( API_KEY , API_SECRET , {
7980 ...userInfo ,
You can’t perform that action at this time.
0 commit comments