improve login trigger flow, handle many possible flow