fix ERR_HTTP_HEADERS_SENT error with oauth and 2fa GitOrigin-RevId: b70bd79fb544121337be27349a967d52da115930