TOOLS-494: fix restorewithauth.js and TOOLS-497: fix dumprestore_auth.js