Skip to content

Instantly share code, notes, and snippets.

@AshutoshSajan
Last active January 24, 2020 14:49
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 AshutoshSajan/0557ca2983ab147425fbfbc897a7286c to your computer and use it in GitHub Desktop.
Save AshutoshSajan/0557ca2983ab147425fbfbc897a7286c to your computer and use it in GitHub Desktop.
const jwt = require("jsonwebtoken");
const User = require("../models/User");
function createToken (id, secret) {
return jwt.sign({
userId: id
},
secret, {
expiresIn: "72h"
})
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment