Skip to content

Commit 7cecbc5

Browse files
Setting ttl to 4 hours.
1 parent f5aa15e commit 7cecbc5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ var VideoGrant = AccessToken.VideoGrant;
1616
var express = require('express');
1717
var randomName = require('./randomname');
1818

19+
// Max. period that a Participant is allowed to be in a Room (currently 14400 seconds or 4 hours)
20+
const MAX_ALLOWED_SESSION_DURATION = 14400;
21+
1922
// Create Express webapp.
2023
var app = express();
2124

@@ -59,7 +62,8 @@ app.get('/token', function(request, response) {
5962
var token = new AccessToken(
6063
process.env.TWILIO_ACCOUNT_SID,
6164
process.env.TWILIO_API_KEY,
62-
process.env.TWILIO_API_SECRET
65+
process.env.TWILIO_API_SECRET,
66+
{ ttl: MAX_ALLOWED_SESSION_DURATION }
6367
);
6468

6569
// Assign the generated identity to the token.

0 commit comments

Comments
 (0)