title: OAuthPrompt Waterfall needs to begin twice to let RouteAsync be called more than once
body: <p>I'm trying to authorize a user with the built in OAuthPrompt. I've combined the virtual assistant template with <code>BotBuilder-Samples\samples\csharp_dotnetcore\46.teams-auth</code> as I will be using the Teams channel for my bot ultimately. My problem occurs based on where in the code I attempt to authorize the user. I've tried two places:</p>
  
  <p>Before showing this, I feel <code>WaterfallDialog</code> is a relevant piece. I am using the Waterfall dialog in the 46.teams-auth minus two steps.:</p>
  
  <pre><code>AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
  {
        PromptStepAsync,
        LoginStepAsync,
  }));
  </code></pre>
  
  <ol>
  <li><p><code>RouteAsync</code></p>
  
  <pre><code>protected override async Task RouteAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))
  {
      var OAuthResult = await dc.BeginDialogAsync(nameof(WaterfallDialog));
      if (OAuthResult.Result == null)
      {
          await dc.Context.SendActivityAsync(MessageFactory.Text("Please press the Login button."), cancellationToken);
      }
      else
      {
            // ... regular route stuff, like luis check etc
      }
  }
  </code></pre></li>
  </ol>
  
  <p>This runs the prompt and I am able to log in, but RouteAsync never gets called again.</p>
  
  <ol start="2">
  <li><p><code>OnInterruptDialogAsync</code></p>
  
  <pre><code>var OAuthResult = await dc.BeginDialogAsync(nameof(WaterfallDialog));
  if (OAuthResult.Result == null)
  {
      await dc.Context.SendActivityAsync(MessageFactory.Text("Please press the Login button."), cancellationToken);
      return InterruptionAction.StartedDialog;
  }
  else
  {
      return InterruptionAction.NoAction;
  }
  </code></pre></li>
  </ol>
  
  <p>This allows my user to log in and then interact with the LUIS portion of the <code>RouteAsync</code> method (which checks if a user is logged in every time before running any LUIS methods). The issue with this one is that because it is in the <code>OnInterruptDialogAsync</code> method when I start the bot in the emulator two threads run through this method and the user gets prompted twice. I've tried to make it so that <code>dc.BeginDialogAsync(..)</code> only gets called once by checking if the <code>dc.ActiveDialog</code> is not <code>OAuthPrompt</code> before calling it, but this only prompts the user once and then never allows them to log in.</p>
  
  <p>I've also tried to set the <code>InitialDialogId = nameof(WaterfallDialog)</code> within <code>MainDialog.cs</code>'s constructor, but this makes it so the user is never prompted.</p>
  
  <p>Any help with this is appreciated. I'm also open to sharing my project but not in a public place. Thank you.</p>