Added a better error catch when html is returned from an auth call

Added a catch if JSON.parse tries to parse and html string.