TOOLS-450 Revert restorewithauth.js

This partially reverts commit bf834456c3e5a02fbe6fed340563a3c5fa548e4c