Skip to content

Instantly share code, notes, and snippets.

@andrewvmail
Created June 23, 2023 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewvmail/1d9d9807a894418c782a1a51da673f61 to your computer and use it in GitHub Desktop.
Save andrewvmail/1d9d9807a894418c782a1a51da673f61 to your computer and use it in GitHub Desktop.
console.log("make-token")
const jwt = require('jsonwebtoken');
let jwtSecretKey = process.env.JWT_SECRET_KEY || "momo";
let data = {
"context": {
"user": {
"avatar": "https://robohash.org/john-doe",
"name": "John Doe",
"email": "jdoe@example.com"
}
},
"aud": "my_jitsi_app_id",
"iss": "my_jitsi_app_id",
"sub": "meet.jitsi",
"room": "*"
}
const token = jwt.sign(data, jwtSecretKey);
console.log(token)
{
"name": "maketoken",
"version": "1.0.0",
"description": "",
"main": "make-token.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"jsonwebtoken": "^9.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment