More tidying. Added ability to tell user they have been auto logged in