using the options domain variable to detect the community domain

When authenticating and passing a domain it never actually used the domain they passed in as it was referencing a non-existing domain variable.