Swapped custom auth for component.

This commit is contained in:
Matthew Dillon 2015-03-23 14:17:57 -08:00
parent 8dbd01c7b1
commit 8e37bce7c7
8 changed files with 33 additions and 82 deletions

View file

@ -1,10 +1,20 @@
module.exports = function(app) {
var express = require('express');
var jwt = require('jsonwebtoken');
var authenticateRouter = express.Router();
authenticateRouter.post('/', function(req, res) {
var token = jwt.sign({
'name': 'Test User',
'role': 'admin'
}, 'secret',
{
expiresInMinutes: 60,
issuer: 'bactdb',
subject: 'Test User',
});
res.send({
'token': 'abc123'
'token': token
});
});