Moved code param redirect from middleware to decorator.