This file is for middleware; if this method is only being used in a single route it should be refactored somewhere sensible in `routes/`