Skip to content

Commit

Permalink
Setting ttl to 4 hours.
Browse files Browse the repository at this point in the history
  • Loading branch information
manjeshbhargav committed Mar 14, 2019
1 parent f5aa15e commit 7cecbc5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ var VideoGrant = AccessToken.VideoGrant;
var express = require('express');
var randomName = require('./randomname');

// Max. period that a Participant is allowed to be in a Room (currently 14400 seconds or 4 hours)
const MAX_ALLOWED_SESSION_DURATION = 14400;

// Create Express webapp.
var app = express();

Expand Down Expand Up @@ -59,7 +62,8 @@ app.get('/token', function(request, response) {
var token = new AccessToken(
process.env.TWILIO_ACCOUNT_SID,
process.env.TWILIO_API_KEY,
process.env.TWILIO_API_SECRET
process.env.TWILIO_API_SECRET,
{ ttl: MAX_ALLOWED_SESSION_DURATION }
);

// Assign the generated identity to the token.
Expand Down

0 comments on commit 7cecbc5

Please sign in to comment.