Refactor the user-interactive auth handling.