AdrianC: Fix env domain to be more robust
AdrianC: Worked on authentication flow