Mailspring/api/routes/accounts.js
2016-06-19 03:02:32 -07:00

24 lines
555 B
JavaScript

const Serialization = require('../serialization');
module.exports = (server) => {
server.route({
method: 'GET',
path: '/account',
config: {
description: 'Returns the current account.',
notes: 'Notes go here',
tags: ['accounts'],
validate: {
params: {
},
},
response: {
schema: Serialization.jsonSchema('Account'),
},
},
handler: (request, reply) => {
const account = request.auth.credentials;
reply(Serialization.jsonStringify(account));
},
});
};