Skip to content

Commit e51de24

Browse files
authored
Add JWT expiration
1 parent 7e8d2f6 commit e51de24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

node/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ app.get("/signed_dashboard/:id", checkAuth, (req, res) => {
7979
const userId = req.session.userId;
8080
const unsignedToken = {
8181
resource: { dashboard: DASHBOARD_ID },
82-
params: { id: userId }
82+
params: { id: userId },
83+
exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration
8384
};
8485
// sign the JWT token with our secret key
8586
const signedToken = jwt.sign(unsignedToken, MB_EMBEDDING_SECRET_KEY);

0 commit comments

Comments
 (0)