Fix http error in authenticate