Revert auth changes

This commit is contained in:
Jori Lallo
2018-01-15 14:07:12 -08:00
parent 1586c5c208
commit 4c9bff478a
3 changed files with 8 additions and 11 deletions

View File

@ -8,9 +8,8 @@ import { presentApiKey } from '../presenters';
import { ApiKey } from '../models';
const router = new Router();
router.use(auth());
router.post('apiKeys.create', async ctx => {
router.post('apiKeys.create', auth(), async ctx => {
const { name } = ctx.body;
ctx.assertPresent(name, 'name is required');
@ -26,7 +25,7 @@ router.post('apiKeys.create', async ctx => {
};
});
router.post('apiKeys.list', pagination(), async ctx => {
router.post('apiKeys.list', auth(), pagination(), async ctx => {
const user = ctx.state.user;
const keys = await ApiKey.findAll({
where: {
@ -47,7 +46,7 @@ router.post('apiKeys.list', pagination(), async ctx => {
};
});
router.post('apiKeys.delete', async ctx => {
router.post('apiKeys.delete', auth(), async ctx => {
const { id } = ctx.body;
ctx.assertPresent(id, 'id is required');