Instead of trying to extend users-permissions routes create separate one use strapi generate cli command and add your logic here in the route controller
Instead of trying to extend users-permissions routes create separate one use strapi generate cli command and add your logic here in the route controller