Add auth and blacklist APIs

This commit is contained in:
MICHAEL JACKSON
2017-11-11 12:18:13 -08:00
parent cc70428986
commit 0e1f26849b
35 changed files with 1166 additions and 339 deletions

View File

@ -0,0 +1,24 @@
const AuthAPI = require('../AuthAPI')
const DefaultScopes = {
blacklist: {
read: true
}
}
function createAuth(req, res) {
AuthAPI.createToken(DefaultScopes).then(
token => {
res.send({ token })
},
error => {
console.error(error)
res.status(500).send({
error: 'Unable to generate auth token'
})
}
)
}
module.exports = createAuth