The fw-cli JS RTR login code was used for folio-scripts.
Additional improvements and fixes were made to the process.
Bring in those improvements and fixes.
see: https://github.com/TAMULib/folio-scripts/blob/8be4a871a17c762b13dfa7aa71374f802accdacd/src/okapi.js#L292 (temporary WIP commit, link will be updated once code is merged.)