Skip to content

Instantly share code, notes, and snippets.

@Mirch
Created November 30, 2018 09:42
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 Mirch/d47dbd68a0e116acfeb9b6830cd23447 to your computer and use it in GitHub Desktop.
Save Mirch/d47dbd68a0e116acfeb9b6830cd23447 to your computer and use it in GitHub Desktop.
app.post('/api/login', (req, res) => {
// Mock user
const user = {
id: 1,
username: '1055984',
email: '1055984@ucn.com'
};
jwt.sign({ user }, 'secretkey',
{ expiresIn: '30s' }, (err, token) => {
res.json({
token
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment