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

19
scripts/create-token.js Normal file
View File

@ -0,0 +1,19 @@
const AuthAPI = require('../server/AuthAPI')
const scopes = {}
AuthAPI.createToken(scopes).then(
token => {
// Verify it, just to be sure.
AuthAPI.verifyToken(token).then(payload => {
console.log(token, '\n')
console.log(JSON.stringify(payload, null, 2), '\n')
console.log(AuthAPI.getPublicKey())
process.exit()
})
},
error => {
console.error(error)
process.exit(1)
}
)