Change username to email in JWT

This commit is contained in:
Matthew Dillon 2015-04-10 11:15:32 -08:00
parent ea43effec8
commit 3f0b074619
3 changed files with 7 additions and 7 deletions

View file

@ -8,15 +8,15 @@ module.exports = function(app) {
var ms = 3000 + new Date().getTime();
while (new Date() < ms){}
if (req.body.username === 'test' && req.body.password === 'test') {
if (req.body.email === 'test' && req.body.password === 'test') {
var token = jwt.sign({
'name': 'Test User',
'role': 'admin'
'role': 'A'
}, 'secret',
{
expiresInMinutes: 60,
issuer: 'bactdb',
subject: 'Test User',
subject: 'test',
});
res.send({
'token': token