routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

UseBefor decorator execute in wrong order

Open cojack opened this issue 2 years ago • 0 comments

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

cojack avatar Oct 25 '21 10:10 cojack