How to get 'ctx.state.user' in custom middleware

What do I need to do to make a policy run after the controller?