Fix picking up auth info from browser.

Difficult to set up tests for this as it's browser only.

I've had good success with phantomjs and wd in some of my projects, might be worth using them to run the tests.