Created
November 30, 2018 09:42
-
-
Save Mirch/d47dbd68a0e116acfeb9b6830cd23447 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
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