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