Last active
January 24, 2020 14:49
-
-
Save AshutoshSajan/0557ca2983ab147425fbfbc897a7286c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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