2019-05-19 04:47:03 +00:00
|
|
|
const AuthAPI = require('../server/AuthAPI');
|
2017-11-11 20:18:13 +00:00
|
|
|
|
2017-11-12 07:30:41 +00:00
|
|
|
const scopes = {
|
|
|
|
blacklist: {
|
|
|
|
read: true
|
|
|
|
}
|
2018-02-18 02:00:56 +00:00
|
|
|
};
|
2017-11-11 20:18:13 +00:00
|
|
|
|
|
|
|
AuthAPI.createToken(scopes).then(
|
|
|
|
token => {
|
|
|
|
// Verify it, just to be sure.
|
|
|
|
AuthAPI.verifyToken(token).then(payload => {
|
2019-05-19 04:47:03 +00:00
|
|
|
console.log(token, '\n');
|
|
|
|
console.log(JSON.stringify(payload, null, 2), '\n');
|
2018-02-18 02:00:56 +00:00
|
|
|
console.log(AuthAPI.getPublicKey());
|
|
|
|
process.exit();
|
|
|
|
});
|
2017-11-11 20:18:13 +00:00
|
|
|
},
|
|
|
|
error => {
|
2018-02-18 02:00:56 +00:00
|
|
|
console.error(error);
|
|
|
|
process.exit(1);
|
2017-11-11 20:18:13 +00:00
|
|
|
}
|
2018-02-18 02:00:56 +00:00
|
|
|
);
|