Skip to content

Commit 5c22d0d

Browse files
author
Tim Mendoza
committed
Update plugin to always return room_type parameter
1 parent 0d9c8f9 commit 5c22d0d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ POST /token
110110
```json
111111
{
112112
"token": "0000000000000000.0000000000000000000000.00000000000000000",
113-
"room_type": "group" | "group-small" | "peer-to-peer" | null
113+
"room_type": "group" | "group-small" | "peer-to-peer"
114114
}
115115
```
116116

src/video-token-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ module.exports.handler = async (context, event, callback) => {
9494
const videoGrant = new VideoGrant({ room: room_name });
9595
token.addGrant(videoGrant);
9696
response.setStatusCode(200);
97-
response.setBody({ token: token.toJwt(), room_type: create_room ? ROOM_TYPE : null });
97+
response.setBody({ token: token.toJwt(), room_type: ROOM_TYPE });
9898
return callback(null, response);
9999
};

test/e2e/e2e.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('the RTC Twilio-CLI Plugin', () => {
147147
.post(`${URL}/token`)
148148
.send({ passcode, room_name: ROOM_NAME, user_identity: 'test user', create_room: false });
149149
expect(jwt.decode(body.token).grants).toEqual({ identity: 'test user', video: { room: ROOM_NAME } });
150-
expect(body.room_type).toEqual(null);
150+
expect(body.room_type).toEqual('group');
151151

152152
try {
153153
await twilioClient.video.rooms(ROOM_NAME).fetch();

test/video-token-server.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe('the video-token-server', () => {
185185

186186
expect(mockCreateFunction).not.toHaveBeenCalled();
187187
expect(callback).toHaveBeenCalledWith(null, {
188-
body: { token: expect.any(String), room_type: null },
188+
body: { token: expect.any(String), room_type: 'group' },
189189
headers: { 'Content-Type': 'application/json' },
190190
statusCode: 200,
191191
});

0 commit comments

Comments
 (0)