8 lines
141 B
JavaScript
Raw Normal View History

2017-11-27 10:59:24 +01:00
module.exports = async (ctx, next) => {
if (!ctx.state.user) {
throw new Error('Authentication is required.');
2017-11-27 12:05:18 +01:00
}
await next();
2017-11-27 10:59:24 +01:00
};