routing-controllers
routing-controllers copied to clipboard
UseBefor decorator execute in wrong order
As we can assume, @UseBefor
should be executed BEFORE method invocation, but unfortunately is executed BEFORE any other middleware which makes no sense and prevents using it as a kind of Guard
for specific endpoint.
As we can see here: https://github.com/typestack/routing-controllers/blob/cf1117dbb655220b544f86eb47d7b17392a4729f/src/driver/express/ExpressDriver.ts#L185