8 lines
138 B
JavaScript
Raw Normal View History

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