2017-11-27 16:47:16 +01:00

8 lines
141 B
JavaScript

module.exports = async (ctx, next) => {
if (!ctx.state.user) {
throw new Error('Authentication is required.');
}
await next();
};