Skip to content

Instantly share code, notes, and snippets.

@WoolDoughnut310
Created October 28, 2022 15:00
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 WoolDoughnut310/1f9765a3acefc863c98593826ecc4371 to your computer and use it in GitHub Desktop.
Save WoolDoughnut310/1f9765a3acefc863c98593826ecc4371 to your computer and use it in GitHub Desktop.
router.post("/login", async (req, res) => {
...
const accessToken = jwt.sign({ id: user._id }, process.env.JWT_SECRET);
res.status(200).json({ accessToken });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment