UNPKG

strapi-plugin-users-permissions

Version:

Protect your API with a full-authentication process based on JWT

8 lines (6 loc) 120 B
module.exports = async (ctx, next) => { if (!ctx.state.user) { return ctx.unauthorized(); } await next(); };