Basic auth refactored and working.