2017-12-07 18:16:15 +01:00

8 lines
138 B
JavaScript

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