How to access ctx.state.user in Middleware?

Thanks for the answer <@748491524249092096> . Also, you can use the strapi.requestContext.get() to get the request context as long as the middleware is called in the context of an HTTP request.

const ctx = strapi.requestContext.get();
console.log(ctx.state.user);