Bug/restart connection if authentication fails #6229